#include #include "bstring.h" /* char* str; // a pointer to our dynamic array of char int size; // the size (length) of my string. // allocation will be size+1, so that // we can store the data AS a c-string */ // these are the stand-alone friend functions to the class ostream& operator<< (ostream& os, const BString& s) { /* for (int i = 0; i < s.size; i++) os << s.str[i]; */ os << s.str; return os; } istream& operator>> (istream& is, BString& s) { return is; } BString operator+(const BString& x, const BString& y) { } bool operator< (const BString& x, const BString& y) { } bool operator> (const BString& x, const BString& y) { } bool operator<=(const BString& x, const BString& y) { } bool operator>=(const BString& x, const BString& y) { } bool operator==(const BString& x, const BString& y) { } bool operator!=(const BString& x, const BString& y) { } // below are the MEMBER functions of the class BString::BString() // initialize an empty string { size = 0; str = new char[1]; // allocate array of size 1 str[0] = '\0'; // put null char in only slot } BString::BString(const char* s) // initalize string object FROM incoming c-string s { size = strlen(s); str = new char[size+1]; // allocate array to appropriate size strcpy(str, s); // copy s into str as a c-string } BString::BString(int x) { } BString::~BString() { } BString::BString(const BString& s) { } BString& BString::operator=(const BString& s) { } BString& BString::operator+=(const BString& s) { } void BString::Display() const { } int BString::length() const { } BString BString::substring(int index, int len) { }