implementation of stack in C++