home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!wupost!spool.mu.edu!umn.edu!lynx!nmsu.edu!opus!afoiani
- From: afoiani@nmsu.edu (Anthony Foiani)
- Subject: Re: QUESTION: TRICKS USING THE ? : OPERATOR
- In-Reply-To: hollasch@kpc.com's message of Wed, 23 Dec 1992 00:16:17 GMT
- Message-ID: <1992Dec29.040142.25385@nmsu.edu>
- Sender: usenet@nmsu.edu
- Organization: NMSU Computer Science
- References: <dsembr01.725056046@starbase.spd.louisville.edu>
- <1992Dec23.001617.9462@kpc.com>
- Date: Tue, 29 Dec 1992 04:01:42 GMT
- Lines: 19
-
-
- In much the same vein, one of my favorites goes something like this:
-
- int a, b, c;
-
- *(c?&a:&b) = val;
-
- Not that this is really "recomended". With one notable exception*,
- your goal should always be the most readable code; if an "if"
- statement is more readable than a nested arithmatic conditional, the I
- recommend the "if" statement. IMHO, of course.
-
- * The IOCCC, of course!
-
- Tony
- --
- Tony Foiani a.k.a. Tkil (afoiani@nmsu.edu) or (tkil@acca.nmsu.edu)
- Supporting: Unix / DOS / VMS / Macintosh / "What's this?"
- Current favorite song: "Take To The Sky", Tori Amos, _Winter_ [CD5]
-