Hi!
I´m trying to fulsh standard input - all though this seems not possible to me. My code is:
When I run this, I don´t expect when typing: "pussy", that the program runs the functions ascossiated with p,u,s,s and types "Unkown command"....Code:bool exit_status; char current; exit_status=false; while(!exit_status){ cin.clear(); cin >> current; switch(current){ case 'p': // do something break; case 'u': // do something break; case 's': // do something break; default: cout << "Unkown command" << endl; } }
Anyone knows how to flush the inputstream so that only function p will be run???