00001 #include "input.h" 00002 00003 #include <iostream> 00004 #include <cstring> 00005 00006 using namespace std; 00007 00008 char get_in_set(const char valid[], const char prompt[], const char errmsg[]) 00009 { 00010 char input; 00011 cout << prompt; 00012 cin >> input; 00013 while (strchr(valid,input) == NULL) 00014 { 00015 cout << errmsg << prompt; 00016 cin >> input; 00017 } 00018 return input; 00019 }