MyString

MyString - /* A SIMPLE STRING CLASS */ /* A SIMPLE STRING...

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

View Full Document Right Arrow Icon
/**** A SIMPLE STRING CLASS ****/ /**** A SIMPLE STRING CLASS ****/ #ifndef MYSTRING_H #define MYSTRING_H #include <cassert> #include <cstring> using namespace std; class String { public: // Constructors String(); // default String( const char *s); // converts char* object to String object String( const String &s); // copy // Destructor ~String(); // Assignment operators const String& operator=( const String &rhsObject ); // Get the character in position Index char operator[]( int Index) const; // Get a reference to the character in position Index char& operator[]( int Index); // Get the length int Length() const; // Friends for comparison friend bool operator== (const String &lhsObject, const String &rhsObject); friend bool operator< (const String &lhsObject, const String &rhsObject); friend bool operator> (const String &lhsObject, const String &rhsObject); friend bool operator<=
Background image of page 1

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

View Full DocumentRight Arrow Icon
(const String &lhsObject, const String &rhsObject); friend bool operator>= (const String &lhsObject, const String &rhsObject);
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 4

MyString - /* A SIMPLE STRING CLASS */ /* A SIMPLE STRING...

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

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