|
|
|
|
|
by AdmiralAsshat
4209 days ago
|
|
They're usually used for an error clean-up section at the bottom. Zed Shaw introduces some debug macros here which make use of a goto: http://c.learncodethehardway.org/book/ex20.html From that point on in the book, pretty much every function written has an "error:" label at the bottom where stuff gets cleaned up and memory freed. You can see his example code for it there. Pretty useful macros, really. Context for the "goto considered harmful" always seems lost on young coders these days, unaware of the kind of spaghetti code that overuse of goto had caused. |
|
Also, never pass up the opportunity to troll a god-fearing "goto puritan" :-)