title: Malloc syntax in C
body: <p>In the books I read that the syntax for malloc is malloc(sizeof(int)) but in one of doubly linked list program I see the following:</p>
  
  <pre><code>newnode=(struct node *)malloc(sizeof(struct node))
  </code></pre>
  
  <p>What is (struct node*) doing here? What is this entire code doing?  btw, the code for the struct in the program is as below. </p>
  
  <pre><code>struct node
  {
  char line[80];
  struct node *next,*prev;
  };
  
  struct node *start=NULL,*temp,*temp1,*temp2,*newnode;
  </code></pre>
  
  <p>Thank you</p>