#include using namespace std; class BString { friend ostream& operator<< (ostream& os, const BString& s); friend istream& operator>> (istream& os, BString& s); friend BString operator+(const BString& x, const BString& y); friend bool operator< (const BString& x, const BString& y); friend bool operator> (const BString& x, const BString& y); friend bool operator<=(const BString& x, const BString& y); friend bool operator>=(const BString& x, const BString& y); friend bool operator==(const BString& x, const BString& y); friend bool operator!=(const BString& x, const BString& y); public: BString(); // init to empty string BString(const char* s); // conversion from c-string BString(int x); // conversion from int to Bstring ~BString(); // destructor BString(const BString& s); // copy constructor (deep copy) BString& operator=(const BString& s); // operator= (deep copy) BString& operator+=(const BString& s); void Display() const; // print the string int length() const; // return the length of the string BString substring(int index, int len); // return substring of this string private: char* str; // a pointer to our dynamic array of char int size; // the size (length) of my string. // allocation will be exactly what is needed };