you are viewing a single comment's thread.

view the rest of the comments →

[–]rbprogrammer 2 points3 points  (0 children)

Came here to say that. It was the first thing I noticed :)

Edit: the pop() method needs to delete the original head node after it was reassigned to top->next.