Can anyone please tell me why this
decides it is going to exit the program?Code:
void InsertNode(NODE *pNode, NODE *pAfter)
{
pNode->pNext = pAfter->pNext;
pNode->pPrev = pAfter;
if (pAfter->pNext != NULL)
pAfter->pNext->pPrev = pNode;
else
pTail = pNode;
pAfter->pNext = pNode;
}
It is supposed to insert pNode into the linked list after pAfter but it is not working, it just exits every single time. grrrr. Any help would be greatly appreciated :)
