Dec 8, 2015 at 2:27am UTC
Hello, I am writing a code in c++ and I need to ask the user to enter the number between 0-4
0= quit
1-4=do something
so at first I use do and while
for example
do
{
}
while (choice!=0);
so it goes back if the user enter any integer but0-4. However when the user enter a character. it won't work and it will quit right away.
Please help. if you wanna see my code please comment below.
Dec 8, 2015 at 2:33am UTC
http://www.cplusplus.com/forum/beginner/180614/
Dec 8, 2015 at 2:41am UTC
sorry @kemort (2314) I thought these forums are different. but how can I delete this?
Dec 8, 2015 at 3:24am UTC
No problem selflearner , treat it as a redirect for anyone planning to post rather than anything else. You don't need to delete this one. A lot of ppl do the same.