[source lang="cpp"]int doWork(){ for (int bar =0; bar < 100; ++bar) { for(int foo = 0; foo < 100; ++foo) { if (foo * bar == 100) { return 1; } } } return 0;}// ...if (doWork()) printf("%d", 100);[/source]how would you replace the goto in this bit with an exception
Or, use a boolean flag for each loop... works too but it's ugly.
EDIT: I guess foo wasn't the best function name, lol.