I could not find a mistake for the second edition of this book. My question is about the if statement in the following code snippet.
void removeHead (Node ** head) { Node * temp; if (!(*head)) { temp = (*head)->next; delete *head; *head = temp; } }
So, I understand that the if-statement point is to check if Node is null. However, adding an extra "!" to evaluation, doesn't this negate the false null value? It would be correct to change it to something like:
if (*head) { ... }
Also, if anyone knows where I can find the official mistake for the 2nd edition, that would be great.
Thanks,
Sam
source share