So I'm reviewing these, and my book is talking about how using cin.ignore helps problems with cin.get reading the null terminator from a previous cin statement.
Here is the example in the book:
Code
char ch;
int number;
cout << "Enter a number: ";
cin >> number;
cin.ignore( );
cout << "Enter a character: ";
ch = cin.get( );
cout << "Thank you.\n"
return 0;
The regular font represents what is output to the screen, the bold represents the user input:
Quote
Enter a number: 100 [Enter]
Enter a character: Z [Enter]
Thank you.
But because cin.get reads the next character, wouldn't it skip to outputting "Thank you." even before the user pressed Enter?