How do I remove or decline user input? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

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
DerpyCoco - avatar
3 Answers
+ 1
Luis remove the email address.
4th Aug 2018, 2:03 AM
Akib
Akib - avatar
4th Aug 2018, 1:15 AM
Louie
Louie  - avatar
0
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
Mike - avatar