home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!mcsun!hp4at!sca
- From: sca@gese.ge14.mdadv.gv.at (Petzi Schweda)
- Subject: Re: The Correct Way To Write C if-Statements
- Message-ID: <1992Nov12.140710@gese.ge14.mdadv.gv.at>
- Originator: sca@gese0n.ge14.mdadv.gv.at
- Sender: usenet@hp4at.eunet.co.at (USENET - Admin account)
- Nntp-Posting-Host: gese.ge14.mdadv.gv.at
- Organization: MD-ADV
- References: <140742@lll-winken.LLNL.GOV> <2184@ontek.com> <1992Nov12.101654.21932@thunder.mcrcim.mcgill.edu>
- Date: Thu, 12 Nov 1992 13:07:10 GMT
- Lines: 46
-
-
-
-
- if (condition)
- nice statement;
- else {
- lot's of statements ...
- }
-
- if (cond)
- do_this;
- else if (cond)
- do_that;
- else got_lost;
-
- for (and so on ...)
- {
- body ...
- }
-
- while(cond)
- {
- and so on ...
- }
-
- Got the main idea ?
- Not only the "if's" but all blocks take the same
- indention: 5 spaces.
- To avoid another discussion: I like to have the
- paranthesis under each other VERY much, especially
- the opening and closin one's. Who the hack has invented
- this unlucky
- if (cond) {
- ugly_statements;
- }
- paranthesis-into-if-line-style ????
-
- regards, Petzi
- --
- ----------------------------------------------------
- Petzi Schweda (sca@gese.ge14.mdadv.gv.at)
- MD-ADV, Municipality of the City of Vienna, Austria
- --
- ----------------------------------------------------
- Petzi Schweda (sca@gese.ge14.mdadv.gv.at)
- MD-ADV, Municipality of the City of Vienna, Austria
-