if(tmpPtr->number<tmpPtr->next_number->number)
{
int tmpV1=tmpPtr->next_number->number;
int tmpV2=tmpPtr->number;
tmpPtr->next_number->number=tmpV2;
tmpV2=tmpPtr->number=tmpV1;
}
This is what I have tried so far, this is supposed to be sorting the linked list as member are being added each time. But when the compiler crashes when I try to put in the second node. The break point is the if statement, if(tmpPtr->number<tmpPtr->next_number->number). I tried really hard to figure out what the problem was, but couldnt.
tmpPtr->next_numberisNULLor uninitialized.if(tmpPtr->number<tmpPtr->next_number->number)