#include // for strlen #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 to store 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& os, BString& s) { } 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]; str[0] = '\0'; // null char in only spot, empty string "" } BString::BString(const char* s) { size = strlen(s); // figure out size of incoming c-string str = new char[size+1]; // allocate space! strcpy(str, s); // this works as long as there is ROOM for '\0' /* for (int i = 0; i < size; i++) str[i] = s[i]; */ } 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) { }