// intarray.h - demo for CS 32 // cmc, 11/2/2011 #ifndef INTARRAY_H #define INTARRAY_H #include using std::ostream; class IntArray { friend ostream& operator<< (ostream &, const IntArray &); public: IntArray(int length=0); // default and one-arg ctor IntArray(const IntArray &other); // copy ctor ~IntArray(); // dtor int getLength() const; // accessor for length int get(int position) const; // accessor for value at position void set(int position, int value); // mutator IntArray& operator= ( const IntArray &right); // assignment operator private: int length; // length of array int *values; // pointer to first array element }; #endif