typedef struct node {
int data;
struct node *next;
} node;
node *new;
new = malloc(sizeof node); // syntax error
new = malloc(sizeof(node)); // working fine
I am trying to assign memory to a new node dynamically using malloc
function, my DOUBT is, why the first statement is giving syntax error? The only difference between the two statement is that in the second one node is inside brackets.