/////////////////////////////////////////////////////////////////// // quoter.cpp - a solution to an problem not used in these // // MidTerm exams. // /////////////////////////////////////////////////////////////////// #include #include typedef std::string str; class quoter { public: quoter(str &qStr) : _qStr(qStr) { _qStr = str("\"") + _qStr + str("\""); } private: str& _qStr; }; int main() { str toQuote = "this will be quoted"; std::cout << "\n " << toQuote; std::cout << "\n " << (quoter(toQuote), toQuote); std::cout << "\n " << (quoter(toQuote), toQuote) << "\n\n"; }