Should I never use goto?

Should I never use goto? My book says that it is bad practice.
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.
What kind of occasions Disch?
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
Read more on goto in this thread:
http://www.cplusplus.com/forum/beginner/2287/
Just don't use it. Act like you've never heard of it.
Topic archived. No new replies allowed.