goto isn't any different than jmp label, so I don't see how it is "bad", I just know it isn't "good practice".
every single major compiler turns loops into labels, and in fact goto can be used for optimization (threaded-execution). It was considered bad because it can lead to memory leaks and it could lead to destructors not being called (due to jumping out of scope), but now the former is solved with smart pointers, and the latter is sovled but it being treated as a bug by compilers (so it can't compile). Apart from that, it just makes readability difficult if overused.
Vampirewolve wrote:
How old is that book? You should not use goto to create loops that's an ancient way.
Rather you should use goto to escape deeply nested loops or to free memory.
if you are nesting deeply enough to warrant goto, you should consider refactoring first (makes things more manageable, and more readable).