waitForEnter() {
char enter;
do {
cin.get(enter);
} while ( enter != \'\\n\' );
}
It works, but not always. It doesn\'t work w
(the first parameter) The name of the array of type char[]
in which the characters read from cin
are to be stored.
(the second parameter) The maximum number of characters to be read. When the specified maximum has been read, input stops.
(the third parameter) The character that is to stop the input process. You can specify any character here, and the first occurrence of that character will stop the input process.
cin.getline( name , MAX, ‘\n’ );
Page 175 IVOR HORTON’S BEGINNING VISUAL C++® 2010