title: Structure memory allocation and malloc() in c
body: <p>when I defined a node in linked list I came across this confusion.
  consider,</p>
  
  <pre><code>struct node *current = head;
  </code></pre>
  
  <p>here <code>head</code> is pointer to head node. and another way is,</p>
  
  <pre><code>struct node *current = (struct node*)malloc(Sizeof(struct node));
  current = head;
  </code></pre>
  
  <p>both works the same so what is the difference between them?
  How is memory allocated in first case?</p>