Homework/HW07/bin-trees-B.cc
void readAndEchoIntResponse (int & response)
{
    cin >> response;
    while (cin.get() != '\n');  // Clear the line.
    cout << response << endl;
}
/************  R E A D   A N D   E C H O   I N T   R E S P O N S E  *********

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