home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!ferkel.ucsb.edu!taco!rock!stanford.edu!agate!biosci!uwm.edu!rpi!psinntp!psinntp!dg-rtp!robin!goudreau
- From: goudreau@robin.rtp.dg.com (Bob Goudreau)
- Newsgroups: comp.lang.c
- Subject: Re: The Correct Way To Write C if-Statements
- Message-ID: <1992Nov16.175117.29633@dg-rtp.dg.com>
- Date: 16 Nov 92 17:51:17 GMT
- References: <1992Nov12.101654.21932@thunder.mcrcim.mcgill.edu> <1992Nov12.140710@gese.ge14.mdadv.gv.at> <3860@dozo.and.nl>
- Sender: nadmroot@dg-rtp.dg.com (nadm root login)
- Organization: Data General Corporation, RTP, NC
- Lines: 23
-
- In article <3860@dozo.and.nl> jos@and.nl (Jos Horsmeier) writes:
- >
- >|Who the hack has invented this unlucky
- >| if (cond) {
- >| ugly_statements;
- >| }
- >|paranthesis-into-if-line-style ????
- >
- >Well, I think it was Dennis M. Ritchie himself who did this, ...
-
- Actually, this isn't quite right. The K&R style is to align the
- terminating brace with the first letter of the "if" (or "while",
- etc.):
-
- if (cond) {
- ugly_statements;
- }
-
-
- ----------------------------------------------------------------------
- Bob Goudreau Data General Corporation
- goudreau@dg-rtp.dg.com 62 Alexander Drive
- +1 919 248 6231 Research Triangle Park, NC 27709, USA
-