// // test << operator. // // assumes constructors work. // #include #include // has EXIT_SUCCESS #include "lstring.h" #include #include "testsub.h" // has functions for testing int main(void) { lstring empty; lstring x('x'); lstring wxyz("wxyz"); char tmpFileName[] = "TMP"; cout << "'' = '" << empty << "'\n"; cout << "'x' = '" << x << "'\n"; cout << "'wxyz' = '" << wxyz << "'\n"; ofstream out; out.open(tmpFileName); out << "'' = '" << empty << "'\n"; out << "'x' = '" << x << "'\n"; out << "'wxyz' = '" << wxyz << "'\n"; out.close(); ifstream in; in.open(tmpFileName); cout << "Written to file:\n"; char c; while (in.get(c)) cout.put(c); in.close(); cout << "That's all, folks!\n"; return EXIT_SUCCESS; }