>>Edit: made a smiley out of my parenthesis :O
That happens a lot. If you scroll down the page you will see a checkbox to disable smilies in text. You may have to click the Go Advanced button to see that checkbox.
Ancient Dragon
Retired & Loving It
30,041 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,341
In my program I am using the do-while loop to go through program..
my question is how do I loop the program without the do-while loop...
rather that when the user enters menu number 0, it quits the program...
Teacher uses a script to grade the programs and on hsi example it just runs over and over without it asking "continue?"
any advice?
you could replace the do-while loop with a simple loop that never ends. Is that what you mean? But having a Quit option I think is a better solution because it tells the user how to exit the program.
while(1)
{
// do something
}
Ancient Dragon
Retired & Loving It
30,041 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,341
plz comment...
OK, here goes:
1) No CODE tags -- they are mentioned inThe Rules as well as all over the site. Even where you typed in your post.
2) English!!!!
i m -- I'm
u -- you
dont -- don't
plz -- please
also mentioned in The Rules. This is not a chat room.
3) Don't return from your case statement.
WaltP
Posting Sage w/ dash of thyme
10,492 posts since May 2006
Reputation Points: 3,348
Solved Threads: 943
@waltp
Sorry but i am new to this community..i didnt know about this....i will take care of this in future..
So you simply ignoreed all the references to The Rules when you signed up? Not good... :icon_rolleyes:and
dont
return
from your
case
statement
why????
Because it's just as easy to exit the loop and let thereal return take care of it. And it's bad programming practice... Ideally, functions should only return from one place. This is not a rule set in stone, but a guideline. It can't always be accomplished.and please comment on the solution...
thanks & regards...
It works fine.
WaltP
Posting Sage w/ dash of thyme
10,492 posts since May 2006
Reputation Points: 3,348
Solved Threads: 943