The "do" statement in C/C++ is "do ... while()"
So you either need to put a while statement at the bottom of your loop
do {
switch(num) {
case '1':
cout << "One";
break;
case '2':
cout << "Two";
break;
case '3':
cout << "Three";
break;
case '4':{
subMenu1();
break;}
case '5':
cout << "Five";
break;
}
} while (/* your condition */);
If an infinite loop is what you want, then use the more standard
while (1) { /* code in here */ }
or
for (;;) { /* code in here */
John
Main Topics
Browse All Topics





by: imladrisPosted on 2003-09-11 at 07:52:38ID: 9337427
A do expects a while with it to explain when to stop:
do
{ //stuff
...
} while( /*condition*/);
where condition is some logical condition, e.g. i<10 or num!=5.