ArrayStack implementation in C++