in this link list i'm trying to make np pointer of the last node null so in insert function it can be recognized to place the correct algorithm. but it jumps from else if(cp->np==0) at the point!
by "p->np = 0" i try to define a NULL pointer. am i wrong?
by "p->np = 0" i try to define a NULL pointer. am i wrong? (sic)
No, you're not wrong. Null is effectively 0. However, this is not the case in C++0x.
Here's a tip for you: If the list is linear, add a separate instantiation of person (pointer) to the root node.
This pointer will point to the last node. That way, you don't have to iterate through all the nodes before finding the last one.