[quote author=Nick Gammon link=topic=107886.msg810173#msg810173 date=1338357763]
Let me just say that in writing C (and C++) code for 20-odd years now, I have never needed to use goto. Occasionally I note that other advanced authors have used it in highly technical situations (like saving stack space when doing tail recursion ... if you don't understand what that means, you don't need to use goto).
Save yourself a lot of hassle: learn to use if, while, do, for, switch and function calls. Not goto.
I once got into an online discussion regarding goto, and someone showed a very interesting example of using goto in the context of a non-switch-case state machine; it was actually fairly elegant and interesting. There was also the common example of using goto to break out of deeply nested if-then constructs (though I tend to wonder if code refactoring might not be a better solution; but, at the same time, I can see why if you had a whole mess of if-then logic, where refactoring might make things worse, in that the code might already be well debugged - and refactoring could actually introduce more bugs or logic errors that might not be self-evident until actually in production, etc).
Yes - goto is an ugly construct, but it does have its uses, but only for "experts" (to some extent).