On Page 41, you state:
Quote:
|
Variables cannot be passed by reference in C, so the solution is to pass a pointer to the variable you want to change - in this case, a pointer to the head pointer.
|
It seems an odd mix to be lamenting the deficiencies of C, when the example code then uses
delete, which does not exist in C, but in C++.
I can appreciate that a reference to a pointer can look confusing as well, but in general, I find the Programming Interviews Exposed book to be a competent tutor, so it somewhat surprised me to see the book shy away from tackling the problem of how to read a type name.
Also, in these examples (as on page 41), you often check to see if
*head is not
NULL, but you seem comfortable in assuming that
head itself is not
NULL. Perhaps this time, I am the cynical one.
Regards,
Matt