What should I do if I only want to display the sentence'Please enter only one char' once? should the user enter more than one character?
My program will repeat the above sentence countless times if enter a garbage like 'aksljdjlsadklsadklasdlkjaslkdjsakldjasljdlk'. I have read the faq but alas do not understand what is being said there.
using namespace std;
cout<<"Please enter only a character\n";
cin.get(c, 10 , '\n');
cout<<"Please enter only one char\n";