I noticed if when prompted to enter my choice, if I press enter (creating an empty line) it didn't detect my input as a 0 length input but rather it just allowed me to enter on the next line down. How do I stop this in an easy way so even if its an empty input it still registers
#include <iostream>
int main()
{
std::string MMOption; //Main Menu Option
std::cout << "Main Menu" << std::endl;
while (MMOption != "6") {
std::cout << "1. New Account" << std::endl;
std::cout << "2. View Account/s" << std::endl;
std::cout << "3. Edit Account" << std::endl;
std::cout << "4. Delete Account" << std::endl;
std::cout << "5. Option's" << std::endl;
std::cout << "6. Exit" << std::endl;
std::cin >> MMOption;
std::cout << std::endl;
}
}
Thanks in advance