I have a simple code:
The questions just keep on going. Now I would only like to use the yn_response variable for each question, so how can i clear its contents ?Code:... char yn_response; cout << "Input data form file ? (y/n)" << endl; cin >> yn_response; if ( yn_response == 'y') { // do something } cout << "Input data form keyboard ? (y/n)" << endl; cin >> yn_response; if ( yn_response == 'y') { // do something } ...