C++ console application raw input mode windows

Sep 17, 2016 at 2:58pm
The c++ console application that I am building asks the user to enter a predefined time for input.The predefined times are **09:00AM OR 12:00PM OR 04:00PM**
I am letting the user enter one value,andthe value is stored in a text file as string.
I am already including validations in the back end,

cin >> resTime;
while (!(resTime == "09:00AM" || resTime == "12:00PM" || resTime == "04:00PM")) {
cout << "Invalid input.Read Instructions and enter valid type\n";
cin >> resTime;
}


The above code snippet shows the back end validation. Is there any way for me to make a front end validation?
For example, when the user hits the Down button on the keybord,the list of times available should be shown( 09:00AM OR 12:00PM OR 04:00PM)

I am running visual C++ in visual studio 2015,my OS is Microsoft Windows 10.
Last edited on Sep 17, 2016 at 2:59pm
Sep 17, 2016 at 6:57pm
What about a menu ?
Enter 1 for 9AM, 2 for 12PM or 3 for 4PM.
Last edited on Sep 17, 2016 at 6:59pm
Sep 17, 2016 at 7:05pm
Oh I dint think about that .Thanks !
Topic archived. No new replies allowed.