Essentially I'm really green when it comes to C++ I've tried going through tutorials and text books to find the elements for the following question but seem to be grasping at straws.
I need to have a user input a character and restrict it to 1 character, or enter q to quit. While the character is not q, it adds + 1 to counter. Once a character enters q, the screen is cleared and a statement is displayed to the user as many times as the counter went up 1. So in this situation I need it to say hi x however many time a character other than q was entered.
My question on it is should I be using : if( n == 'q' || n == 'Q')
break;
for it to end the while loop? and I'm a bit lost on how to have it repeat hi, by the amount on the counter.