title: How to allocate memory while using typedef?
body: <p>I have a code segment which goes something like this</p>
  
  <pre><code>typedef struct node* node_t;
  
  struct node{
  int value;
  node_t link;
  };
  
  ......
  ......
  ......
  
  //now I want to allocate memory somewhere else in the program.
  node_t x;
  x=(node_t) malloc(sizeof *x);
  </code></pre>
  
  <p>Could you please tell me if the above statement is proper? Eclipse shows this warning</p>
  
  <pre><code>warning: implicit declaration of function ‘malloc’ [-Wimplicit-function-declaration]
  ../tree.c:22:9:
  warning: incompatible implicit declaration of built-in function ‘malloc’    
  </code></pre>
  
  <p>Can someone explain in detail about situations like this? What is actually wrong with this. I would really appreciate if you could list all the possible ways in which I can allocate memory in this program? Thank you in advance..</p>