Sam Ismail wrote:
certainly a sublime satisfaction in designing elegant code with do..while
and while loops (I rarely use for's), but C really suffers from a lack of
a general error trapping mechanism that one can invoke to break out of
loops as required. Sometimes I think goto's are the answer but I can
never find an appropriate way to implement it.
I'm not sure if Fortran treats jumping out of a loop the same as C or not,
but when I was taking Fortran in college, I wrote a program for shuffling
and dealing out pseudo random bridge hamds. When writing it, for whatever
reason I jumped out of a For/Next loop. For some reason the program
crashed. I didn't know you couldn't do that and finally after stumping the
instructors, one of them took the time to again review the code and found
that "minor" glitch. Ah, the fun of learning!