How do I remove or decline user input? | Sololearn: Learn to code for FREE!

How do I remove or decline user input?

I want the user to only choose between 2 characters: c and t. so how do I exclude other alphabet and numbers.

3rd Aug 2018, 11:02 PM
DerpyCoco - avatar
3 Antworten
+ 1
Luis remove the email address.
4th Aug 2018, 2:03 AM
Akib - avatar
4th Aug 2018, 1:15 AM
Louie  - avatar
I'm not very experienced with cpp but maybe just set an array of accepted values and do a single if statement to see if array contains user input. You could either do nothing if user provides invalid input or notify user of invalid input. Either way you should only need to write a line or two.
4th Aug 2018, 1:11 PM
Mike - avatar