//File : SimpleVector.h //Author : Andre Long and Tony Gaddis (Book Author) //Due : November 30, 2004 //Description : Make homemade push_back and pop_back functions which emulate their counter // parts in the STL //SimpleVector class template #ifndef SIMPLEVECTOR_H #define SIMPLEVECTOR_H #include #include #include using namespace std; template class SimpleVector { private: T*aptr; T*bptr; int arraySize; void memError() { cout<<"ERROR: Cannot allocate memory. "< 0) delete [] aptr; }//ends destructor int size() { return arraySize; } T &operator[] (const int &sub) { if(sub < 0 || sub > arraySize) { subError(); } return aptr[sub]; } void pushBack( T val) { bptr = new T[arraySize+1]; for(int count=0; count