// MyArray.h // Simple template for a simple array class // CS210 - S'03 - 3/18/03 - Ray S. Babcock // #ifndef MYARRAY_H_ #define MYARRAY_H_ template class MyArray { public: MyArray(int = 10); ~MyArray(); void FillArray(T=2); void PrintArray(); private: T* ArrayPtr; int size; }; // end class MyArray // For class templates, this file should contain // the member function definitions also. template < class T > MyArray::MyArray(int s) { if(s <= 0) s = 10; size = s; ArrayPtr = new T[s]; } template < class T > MyArray::~MyArray() { delete [] ArrayPtr; } template < class T > void MyArray::FillArray(T value) { for(int i=0; i void MyArray::PrintArray() { for(int i=0; i