#include using namespace std; #include "int_array.h" // Member function definitions for the integer array class. These // should each be quite clear from their definitions. int_array::int_array() : elements_(0), n_(0) {} int_array::int_array( int n ) : elements_(new int[n]), n_(n) {} int_array::int_array( int n, const int& init ) : elements_(new int[n]), n_(n) { for ( int i=0; ielements_[i] = init; } int_array::int_array( const int_array& rhs) { copy( rhs ); } int_array::~int_array() { delete [] elements_; } const int_array& int_array::operator= ( const int_array& rhs ) { if ( this != &rhs ) { delete [] elements_; copy( rhs ); } return *this; } void int_array::resize( int n ) { delete [] this->elements_; this->n_ = n; this->elements_ = new int[n]; } void int_array::copy( const int_array & rhs ) { this->n_ = rhs.n_; this->elements_ = new int[ this->n_ ]; for ( int i=0; in_; ++i ) this->elements_[i] = rhs.elements_[i]; } bool operator==( const int_array& lhs, const int_array& rhs ) { if ( lhs.size() != rhs.size() ) return false; for ( int i=0; i