#include // for usage of 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; // use library version of << to print c-string 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'; // setting to "" } BString::BString(const char* s) { size = strlen(s); // size of incoming cstring str = new char[size+1]; // allocate the actual array to size+1 /* for (int i = 0; i < size; i++) str[i] = s[i]; */ strcpy(str, s); // will work as long as we are storing '\0' } 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) { }