OverLoadedOpp - #include #include ...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 #include <iostream> #include <string.h> using namespace std class String { public: // constructors String() String(const char *const) ~String() // overloaded operators char operator[](int offset) const // General accessors int GetLen()const { return itsLen } const char * GetString() const { return itsString } private: String (int) // private constructor char * itsString unsigned short itsLen } // default constructor creates string of 0 bytes String::String() { itsString = new char[1] itsString[0] = '\0' itsLen=0 // cout << "\tDefault string constructor\n" // ConstructorCount++ } // private (helper) constructor, used only by // class methods for creating a new string of // required size. Null filled. String::String(int len)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/19/2008 for the course CSE 122 taught by Professor Yoxheimer,ericch during the Fall '07 term at Penn State.

Page1 / 4

OverLoadedOpp - #include #include ...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online