Tracy Nelson on Sat, 29 Jul 2000 10:38:39 -0400 (EDT)


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] 'goto' in C code


As a rule of thumb, I try to never use gotos that transfer control outside
the current routine.  They are handy for breaking out of several levels of
nesting (actually, the continue and break statements are just
thinly-disguised gotos), and I have used them to good effect  to branch to
some error handling code, but in general they're not that useful.  If your
code is structured properly (and the problem you're addressing isn't too
hairy ;) then they're rarely needed.  AAMOF, I've been coding in C for close
to 20 years, and I've only used them a handful of times.

-----Original Message-----
From: Daniel K. Spicer <spicer@linuxmania.com>
To: plug@lists.phillylinux.org <plug@lists.phillylinux.org>
Date: Friday, July 28, 2000 14:31
Subject: [PLUG] 'goto' in C code


|Does anyone have a reason why goto should not be used in C code ??



______________________________________________________________________
Philadelphia Linux Users Group       -       http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mail/listinfo/plug-announce
General Discussion   -   http://lists.phillylinux.org/mail/listinfo/plug