// FILE: charlene.cc //PURPOSE: To show how to input a line of characters one character at a time // and what you get as a result. #include // required for EXIT_FAILURE etc #include // required for external file streams int main() //Pre: Waits for user to input a line of text and then // Post: A line of cin is written to cout as integers. // Until the user inputs a CTRL/C (interupt)or CTRL/D (EOT) // The last character processed from cin is ; // the last character written to cout is code for . { // Local data ... const char nwln = '\n'; // newline character char next_ch; // inout: character buffer // Copy all data characters from cin file stream to cout file stream. cin >> next_ch; while ( (next_ch != nwln) && !cin.eof ()) { cout <> next_ch; } // end while return EXIT_SUCCESS; } // end copy_line