This code is for adding an employee profile at the beginning of a linked list. For some reason, which i cannot identify, this code worked once, and then it just printed the printf and then exited the loop. Even after entering numerous records, it was still doing the same thing. So can anyone identify the problem??
void insert_tobeg() {
char name[15];
struct employee *newPtr;
printf("\n\n\tEnter the record to be entered:");
gets(name);
if(strcmp(start->name, name) == 0) {
curr = (struct employee*)malloc(sizeof(struct employee));
employee_entry();
curr->newPtr = start;
start = curr;
printf("\n\n\tRecord has been added at the beggining!");
return;
}
}