I try to do linked list for inserting. But when i try the gets(newPtr->name), it never work. It just skip off. Also , the code i posted here are reduced to the most simple + working because it's an assignment and I dont want to be in trouble.
Code:newPtr = malloc (sizeof(node)); //Create a node with newPtr pointing to it do{ //I skip some syntax which is crucial in linked list........<--bcause //it's an assignment printf("Name:"); gets( newPtr -> name);//not working printf("Course: "); gets( newPtr -> course); printf("ID: "); scanf("%d", &newPtr -> id); printf("Score: "); scanf("%f", &newPtr -> score); printf("=================================================\n"); printf("Do you wish to continue? 'S' to STOP:"); scanf(" %c", &status); printf("================================================\n"); }while(status != 'S'); //continue loop while state is not 'N'



3Likes
LinkBack URL
About LinkBacks



