1 #include 2 #include 3 4 typedef struct node_t{ 5 int i; 6 struct node_t* link; 7 }node; 8 9 node* head =
head is a global varibale. Global and static varibales must be initialized by constant expressions, i.e. literals. so you can't do
head
node* head = (node *)malloc(sizeof(node));