I have a code segment which goes something like this
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);
Could you please tell me if the above statement is proper? Eclipse shows this warning
warning: implicit declaration of function ‘malloc’ [-Wimplicit-function-declaration]
../tree.c:22:9:
warning: incompatible implicit declaration of built-in function ‘malloc’
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..