I was trying different things in testing how cin.get works and came to this puzzle:
char input[5];
int value;
cout << "enter something:";
cin.get(input,5);
cout << input;
cin.ignore();
cin.get(); // this never fires with only enter
If I enter something, it will pause at the last cin.get. If I just hit return, it never triggers the last cin.get and closes out. Just curious as to what is going on.
If cin.get() could not read anything, it will set the failbit, so the next cin.get() would just fail also.
If you want the next cin.get() to work, cin.clear() must be called first to clear the failbit.
ps. check here for a detailed explanation.