|
![](/i/fill.gif) |
You are right.
However I think there are some places where the use of goto (at least in
C and C++) is more or less reasonable:
- Case 1:
for(cond1)
for(cond2)
while(cond3)
if(skip) goto end_loops;
end_loops:
...
- Case 2:
recalculate_initial_values:
make_some_calculations;
for(cond1)
for(cond2)
while(cond3)
if(wrong_values) goto recalculate_initial_values;
- Case 3:
calculation1;
if(error) goto end_calculations;
calculation2;
if(error) goto end_calculations;
calculation3;
if(error) goto end_calculations;
calculation4;
if(error) goto end_calculations;
handle_results;
end_calculations:
clean_up;
However, I haven't needed the goto-statement in years, though (and I make
a LOT of C++ code). I can only deduce that usually goto is not needed.
--
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
Post a reply to this message
|
![](/i/fill.gif) |