#ifndef MYSTRING_H #define MYSTRING_H #include //for class ostream #include //for the data type size_t using namespace std; class mystring { size_t n; //number of bytes in the block of memory char *p; //points to the first byte in the block of memory public: mystring(const char *initial_p); //plain old constructor mystring(const mystring& another); //"copy" constructor ~mystring() {delete[] p;} //destructor mystring& operator=(const mystring& another); char operator[](size_t i) const; //member func of const mystring object char& operator[](size_t i); //member func of mystring object friend ostream& operator<<(ostream& ost, const mystring& s) { return ost << s.p; } }; #endif