cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
Should I never use goto?
Should I never use goto?
Jan 28, 2011 at 12:20am UTC
Kieth89
(94)
Should I never use goto? My book says that it is bad practice.
Jan 28, 2011 at 12:31am UTC
Disch
(13742)
There are a few occasions where its use is warranted. But they're rare.
If you find yourself using it, you probably shouldn't be.
Jan 28, 2011 at 12:48am UTC
quirkyusername
(792)
What kind of occasions Disch?
Jan 28, 2011 at 12:50am UTC
closed account (
3hM2Nwbp
)
I'd say that if you have nested loops and want to break outside both (or more, if you're more than 2 loops deep) of them without a flag, then it would be warranted, but that's just my opinion.
Last edited on
Jan 28, 2011 at 12:51am UTC
Jan 28, 2011 at 1:02am UTC
Duthomhas
(13206)
Read more on
goto
in this thread:
http://www.cplusplus.com/forum/beginner/2287/
Jan 28, 2011 at 1:14am UTC
shadowvillian
(135)
Just don't use it. Act like you've never heard of it.
Topic archived. No new replies allowed.