title: 'list' undeclared (first use in this function)
body: <p>I have below code.
  I am getting error as <code>'list' undeclared (first use in this function)</code>.
  Please help me</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  struct list{
  int data;
  struct list *next;
  };
  typedef struct list *head;
  
  int main()
  {
      struct list *start;
      int i;
  
      start = (list *) malloc(sizeof(struct list));
      printf("\nEnter the data : \n");
      scanf("%d", &amp;i);
      start-&gt;data = i;
      start-&gt;next = NULL;
      while(list-&gt;next != NULL)
      {
          printf("%d ", list-&gt;data);
          list = list-&gt;next;
      }
  
      return 0;
  }
  </code></pre>