class IntArrayStack { private: int *data, // pointer to dynamically allocated array capacity; // capacity of stack, size of array bool elastic; // true if capacity of stack (i.e. the size of the array) // can be changed as required. int count; // number of values on stack public: // creates an "elastic" stack IntArrayStack (); // creates a stack with a fixed capacity IntArrayStack (int capacity); IntArrayStack (const IntArrayStack &otherStack); ~IntArrayStack (); // throws an "overflow_error" exception if the stack has a fixed // capacity and is full. void push (int value); // throws an "overflow_error" exception if the stack is empty int pop (); bool isEmpty() const { return count == 0; } int getcount() const { return count; } // copies contents only (capacity attributes are not copied). // throws an "overflow_error" exception if the destination stack // has a fixed capacity and this is not large enough. IntArrayStack& operator= (const IntArrayStack &otherStack); };