Homework/HW07/bin-trees-B.cc
void readAndEchoCharResponse (char & response)
{
    char junk;  // Holds chars that trail the desired response char.

    cin >> response;
    while (cin.get() != '\n'); // Clear the line.
    cout << response << endl;
}
/************  R E A D   A N D   E C H O   C H A R   R E S P O N S E  *********

This utility function assumes that an interactive user has been prompted
to enter a one-character response, followed by a newline character.
It reads the first non-white-space response character and then clears all 
other characters from the input stream, up through the first newline character.
It also echoes the character back to the user.  Documented and coded by  
W.Knight. */
R E A D   A N D   E C H O   C H A R   R E S P O N S E
This utility function assumes that an interactive user has been prompted
to enter a one-character response, followed by a newline character.
It reads the first non-white-space response character and then clears all
other characters from the input stream, up through the first newline character.
It also echoes the character back to the user.  Documented and coded by
W.Knight.
R E A D A N D E C H O C H A R R E S P O N S E This utility function assumes that an interactive user has been prompted to enter a one - character response followed by a newline character . It reads the first non - white - space response character and then clears all other characters from the input stream up through the first newline character . It also echoes the character back to the user . Documented and coded by W . Knight .
void readAndEchoCharResponse (char & response)
{
    char junk;  
    cin >> response;
    while (cin.get() != '\n'); 
    cout << response << endl;
}
void readAndEchoCharResponse ( char & response ) { char junk ; cin >> response ; while ( cin . get ( ) != ' \n ' ) ; cout << response << endl ; }
R E A D   A N D   E C H O   C H A R   R E S P O N S E
This utility function assumes that an interactive user has been prompted
to enter a one-character response, followed by a newline character.
R E A D A N D E C H O C H A R R E S P O N S E This utility function assumes that an interactive user has been prompted to enter a one - character response followed by a newline character .
// Holds chars that trail the desired response char. // Clear the line.