0

when i use the code below,

char command;
cin >> command;

i want to get only ('a','c','d') as inputs. In other alphabet(int) cases, i can solve the problem using 'switch statement'

But when someone types multiple characters, my program doesn't know what is the problem. Just, take one charcter of multiple characters.

In conclusion, I want to detect the multiple character input case. And this happens, i want to print error, then program to keep running.

gun bos
  • 51
  • 4

0 Answers0