I am new to the linked list, now I have few problems with the population of nodes.
Here I could populate the first node of the linked list, but the gets() function does not seem to pause execution to populate the next node.
The output is similar:
Var name : var Do you want to continue ?y Var name : Do you want to continue ? // Here I cannot input second data
Here is my code:
struct data { char name[50]; struct data* next; }; struct data* head=NULL; struct data* current=NULL; void CreateConfig() { head = malloc(sizeof(struct data)); head->next=NULL; current = head; char ch; while(1) { printf("Var name : "); gets(current->name);
Bijoy source share