goto Statement
Avoid using a goto statement, except to break out of nested loops.
int test (int i) {// example of bad code
i = i + 2; tst: if (i > 10) ret: return i + 2; i = i - 3; if (i < 1) goto ret; i = i + 5; goto tst;}
Previous slide
Next slide
Back to first slide
View graphic version