this is part of my code, the output isCode:strcut Node * curPtr; strcut Node relation[10]; curPtr= (strcut Node * )relation[0]; while(curPtr->nextPtr != NULL)//find the last node of the list { printf("error check 1\n"); fflush(stdout); curPtr =(struct Node)curPtr->nextPtr; if(curPtr ==NULL) { printf("2");} }
error check1
error check1
Segmentation Fault (core dumped)
I ran it with gdb, it says that the line
[while(curPtr->nextPtr != NULL)//find the last node of the list]
is wrong. Need help!!