/* DemoEscapes.cpp CIS 150 6/3/2008 David Klick This program demonstrates escape sequences. */ #include using std::cin; using std::cout; void cont(); int main() { cout << "Hello, world!"; cout << "\b\b\b\b\b\bDave\n"; cout << "Col1\tCol2\n"; cout << "Dave is to blame.\rKent\n"; cout << "I said, \"Hello!\"\n"; cout << "It isn't what you think.\n"; cont(); return 0; } void cont() { if (cin.rdbuf()->sungetc() != -1 && cin.get() != '\n') cin.ignore(80,'\n'); cout << "Press enter to continue..."; cin.get(); } /* Sample output from two runs of program: Hello, Daved! Col1 Col2 Kent is to blame. I said, "Hello!" It isn't what you think. */