// File simpleString.h // Definition of a simpleString class #ifndef SIMPLESTRING_H #define SIMPLESTRING_H class simpleString { public: // Most non-POD classes should define a // default constructor // destructor // copy constructor // assignment operator //default constructor simpleString(); //destructor virtual ~simpleString(); //copy constructor simpleString (const simpleString &); //assignment operator const simpleString & simpleString::operator= (const simpleString &); // Member functions // Read a simple string void readString(); // Display a simple string void writeString() const; // Retrieve the character at a specified position // Returns the character \0 if position is out of bounds. char at(int) const; // Return the string length int getLength() const; private: // Expand capacity of the contents array void expandCapacity(); static const int INITIAL_CAPACITY = 4; // of the contents array static const int MAX_CAPACITY = 1000000; // of the contents array int capacity; // capacity of the contents array char * contents; // array of characters int length; // number of characters in contents }; #endif //SIMPLESTRING_H