#ifndef int_array_h_ #define int_array_h_ // Definition for an integer array class. Most of the member // functions (methods) are self-explanatory. class int_array { public: // A variety of constructors int_array( ); int_array( int n ); int_array( int n, const int& init ); int_array( const int_array& rhs ); // Destructor ~int_array(); const int_array& operator= ( const int_array& rhs ); void resize( int n ); // change the size of the array. int size() const { return this->n_; } int& operator[]( int i ) { return this->elements_[i]; } const int& operator[]( int i ) const { return this->elements_[i]; } friend bool operator==( const int_array& lhs, const int_array& rhs ); friend ostream& operator<<( ostream& ostr, const int_array& rhs ); private: void copy( const int_array & rhs ); private: int* elements_; int n_; }; #endif