experimenting with npop

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
void npop(qnode*& ntop) {
/*
* many C++ programmers wrile constant at first, then the variable in == statements,
* because very common mistake - to write = instad == in comparison
*/
if (NULL == ntop) {
// exit(0); - this is awfull! don't do this, it's like goto
return;
}
while(NULL != ntop->next) {
ntop = ntop->next;
}
return;
}