Hi, I'm having a problem with my code, no error, it's just the logic that is wrong
program asks for a char and then proceeds to ask for a phrase, it will count the char that the user chose and it will also count all the chars. Problem is when it's time to enter the phrase it doesn't give the time to the user to enter the phrase and it proceeds normally as if a phrase had been entered
After line 9 with cin>>countingChar the '\n' (enter character) is still left in the buffer.
It is this '\n' that is inputted in cin.get() ;
To fix this, ignore the next char input after the first input. .i.e
1 2 3 4 5 6 7 8 9 10 11 12
cin>>countingChar;
cin.ignore(); //will ignore the '\n';
cin.get(); //will now ask you for input.
OR
cin>>countingChar;
fflush(stdin); //flush (empty) input buffer
cin.get();