I think that your problem is same as in this:
1 2 3 4 5 6
|
using std::cin;
std::string word;
int number;
cin >> number;
std::getline( cin, word );
|
Line 5 does
formatted input. It will skip leading whitespace, read integer, and leave the non-digit following the number into the stream.
Typical user presses 'Enter' after the digit. A newline character.
Line 6 does
unformatted input. It copies everything into word, except next newline, which is then removed from the stream.
Oh no! The line 5 left bare newline to the stream, so the "everything" that gets copied contains nothing.
As test, when your program asks for 1 or 2, do write:
It will still "skip" the first question, but actually that question will get "fubar" as input.
So, what to do? You have to remove the (probable) newline character from the stream after the cin>>counter
See the member ostream's function
ignore