#include class IntEArray; class ElementRef { public: ElementRef( IntEArray& theArray, int i ); ElementRef( const ElementRef& other ); ~ElementRef(); ElementRef& operator=( const ElementRef& rhs ); ElementRef& operator=( int val ); operator int() const; private: IntEArray *intArrayRef; int index; int value; }; class IntEArray { public: IntEArray(); IntEArray( const IntEArray& other ); ~IntEArray(); IntEArray& operator=( const IntEArray& rhs ); ElementRef operator[]( int i ); IntEArray operator()( int start, int end ) const; void set(int value, int index); int get(int index); bool updated; private: void reallocateArray(int newSize); bool shared(const int index); int *arrayPointer; int *refCount; //RecNode *offsets; int offSet, endOffset; int size; };