// @topic W10-2-020 IntStack class using dynamic array v2
// @brief class IntStack declaration with copy constructor and overloaded operator=
#ifndef INT_STACK_H_INCLUDED_
#define INT_STACK_H_INCLUDED_
class IntStack
{
static const int DEFAULT_SIZE = 1;
int * memory_block;
int top_of_stack; // = 0;
int capacity;
public:
// constructors and destructor
IntStack(); // default constructor
IntStack( IntStack const& another ); // copy constructor
~IntStack(); // destructor
// operations
// overloaded assgn operator:
IntStack& operator=( IntStack const& another );
void push( int value );
void pop();
int top() const;
int size() const; // how many elements stack has
private:
void allocate_memory( int block_size );
void reallocate_memory( int block_size );
};//class IntStack
#endif // INT_STACK_H_INCLUDED_