Breaking out of several nested l

Brandon Allbery bsa at ncoast.UUCP
Thu Nov 1 04:48:30 AEST 1984


> Article <7200001 at hpdsa.UUCP>, from decot at hpdsa.UUCP (decot)
+----------------
| If you have several nested loops, put the one you want out of (and everything
| within) into a new function, and use "return" to get out.  It will probably
| be clearer to the reader, too.
| 
| Dave Decot  hpda!decot

I hate to tell you, but some of us have to program in the real world.
I've found that for myself and most people I know, the use of C functions
is to mark the ``main'' working components of the program, and using
them to ``modularize'' loop bodies can become even more unreadable than
totally unstructured programming (you can't easily tell that the function
is a loop body).

--bsa
  Brandon Allbery @ North Coast Xenix  |   the.world!ucbvax!decvax!cwruecmp!
6504 Chestnut Road, Independence, Ohio |       {atvax!}ncoast!{tdi1!}bsa
   (216) 524-1416             \ 44131  | E1439 at CSUOHIO.BITNET (friend's acct.)
---------------------------------------+---------------------------------------
			Save the 8-bit computer!  :-)



More information about the Comp.lang.c mailing list