hi i have created a linked list with nodes and what not. i am trying to now search the nodes, expecially the task of each node for a certain string which the user would put in. i have written the code but it doesnt appear to work. i have located where it stops and have indicated it below. any help or tips would be appreciated. thanks
insert
Code:
printf("Search Text: ");
char ch1[MAX_LINE]; //create array
fgets( ch1, MAX_LINE, stdin ); // store input into array
node *ptr; // create pointer
ptr = list; //assign to head of linked list
while(ptr != NULL){ //run through the list
char *found; //create pointer
found = strstr(ptr->task,ch1); // assign found to whatever strstr find. either NULL or something strstr foind
if(found != NULL){
printCurrent(ptr); //if strstr found somethin, print the node
}
ptr = ptr->next; //go to next node
}
printf("\n");