Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int validateStringInput(std::string input, std::string validInput[], std::string errorMsg)
- {
- int inputIndex = 0;
- std::cin.ignore();
- getline(std::cin, input);
- bool inputb = true;
- input = changeStringToLower(input);
- while(inputb)
- {
- for (std::string s : validInput)
- {
- if (s.compare(input) == 0)
- {
- inputb = false;
- break;
- }
- else if (inputIndex == 4)
- {
- printSpace(errorMsg);
- }
- inputIndex++;
- }
- }
- return inputIndex;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement