#include #include using namespace std; namespace XZhangNameSpace{ class BoxedString:public string{ friend ostream& operator<<(ostream & output, BoxedString str); public: BoxedString (char b='*'):border(b) { //intentinally empty } //Calling base class's contructor to initialize data members //inherited from parent class BoxedString (string str, char b='*'):string(str),border(b) { //intentinally empty } int length(); private: char border; }; int BoxedString::length() { return string::length()+4; } ostream& operator<<(ostream & output, BoxedString str){ int len = str.length(); for (int i=0;i str; //C++ way... output <<" "<> str; cout <> str1; cout <