   Problems with my HasParent()    
  Here's the problem: I'm writing my own doubly linked list (see here) and I have a boolean function in my CNode class called 'HasParent()'. This is supposed to come in handy during attachments/detachments, when I need to see if the node already has a parent. Seems logical enough, I think.This is how my HasParent() function goes:bool HasParent(){if(pParent != NULL)return true;elsereturn false;} // end HasParent The project compiles nicely but crashes upon execution. When I debug I'm pointed to the line "if(pParent != NULL);"This may have to do with one of my Attach, AttachTo, or Detach functions. I was never good at debugging (btw, if anyone could point me to some helpful resources online). If my entire CNode code would be of any help, here is the link again: here).Please, any help you can provide. Thanks in advance.// "Programmers don't byte, they nibble a bit."// chimaera  [edited by - chimaera on April 1, 2003 5:12:23 PM][edited by - chimaera on April 1, 2003 10:10:55 PM]
  If the problem occurs within an Attach() function, the node you''re passing is a NULL pointer.  You can fix this with a line at the beginning of your Attach() function like so:if (pNewNode == NULL)return;If it happens within the Detatch() or AttatchTo() functions, the node is somehow getting deleted before it''s finished.  ;  skipp the if statmentreturn (parent != 0);[edited by - leadorn on April 2, 2003 2:31:00 AM]