OverLoadedOpp

OverLoadedOpp - #include <iostream> #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.

Page1 / 4

OverLoadedOpp - #include &lt;iostream&gt; #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