1 #ifndef INTARRAY_H 2 #define INTARRAY_H 3 #endif 4 5 using namespace std; 6 7 class IntArray; 8 9 10 class IntArray{ 11 12 public: 13 //constructors 14 //explicit IntArray(int size = DefaultArraySize); 15 IntArray(); 16 explicit IntArray(int); 17 IntArray( int *array, int array_size); 18 IntArray(const IntArray &rhs); 19 20 //destructor 21 22 ~IntArray(){ delete [] ia; }; 23 24 //operators 25 bool operator==(const IntArray &); 26 bool operator!=(const IntArray &); 27 //assignment operator 28 IntArray& operator=(const IntArray &); 29 //index operator 30 int& operator[](int); 31 32 int size() const; 33 void sort(); 34 35 int min() const; 36 int max() const; 37 38 int find( int value) const; 39 40 41 42 private: 43 static const int DefaultArraySize = 255; 44 int _size; 45 int *ia; 46 }; //remember the colon 47 48