Receiving integers, but also want to test for char.
- by Wayne Haworth
Say I am looking to receive a series of numeric values and read them into an int, but I also want to test if the user hit key 'x'.
I am sure I am missing something obvious, and have tried a few things but seem to be stuck.
This is what I have so far...
cout << endl << "Enter key (or 'x' to exit): ";
cin key;
if (key == 'x') { cout << "exiting";}
// continue on...