Stack using nodes in c++