CSC 311

Winter 2002

Assignment 3

Due: Wednesday, January 30th.

The version of the CharStack class that appears on the Programs page uses a statically allocated array to hold stack items.  Please create a new version of the class that uses dynamic memory management to allocate the array.  Besides modifying the member variables and member functions that are already there, you will need to add a copy constructor, a destructor, and an overloaded assignment operator.  Also, design the class so that if an attempt is made to push onto a full stack, the array stack is automatically resized.

A program called testCharStack.cpp is available for testing your implementation.

What to submit

In one e-mail message, attach two files, one called charstack.h containing the class definition and one called charstack.cpp containing the class implementation.