4 ms·
In C, goto is useful for jumping from various parts of a function to a single section of resource-cleanup-and-return code. I might also use goto as a way to bre
by Gracana 12y ago
In C, goto is useful for jumping from various parts of a function to a single section of resource-cleanup-and-return code. I might also use goto as a way to break out of a set of nested loops. I think those are both generally accepted idioms among C programmers.
- deleted 12y ago[deleted]
- shabbyrobe 12y ago> Only because C doesn't have proper control structures for doing otherwise. Yes it does: it has goto, which works absolutely fine for both purposes.
- deleted 12y ago[deleted]
- Gracana 12y agoI did not cite C as an example of ideal code style or convention.
- deleted 12y ago[deleted]