Code written in C++ to implement the concept of Dynamic Stack