home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!Germany.EU.net!horga!reswi!smart.bo.open.de!tom
- From: tom@smart.bo.open.de (Thomas Neumann)
- Newsgroups: comp.lang.c
- Subject: Re: a ? b : c = d; /* legal ? */
- Date: 20 Dec 1992 14:06:18 GMT
- Organization: News at smart
- Lines: 23
- Message-ID: <1h1ukqINNodo@smart.bo.open.de>
- References: <BzDA4u.459@cdsmn.mn.org>
- NNTP-Posting-Host: smart.bo.open.de
- X-Newsreader: Emacs 18.59.1, GNUS 3.14.1
- In-reply-to: wells@cdsmn.mn.org's message of Wed, 16 Dec 1992 19:29:17 GMT
-
- >>>>> Regarding a ? b : c = d; /* legal ? */; wells@cdsmn.mn.org (Rich Wells) adds:
-
- wells> Is the statement:
-
- wells> a ? b : c = d;
-
- wells> where a, b, c, and d are all integers, a valid C expression?
-
- You can do it like this
-
- int a, b, c, d;
- *(a ? &b : &c) = d;
-
- to force the lhs to be an lvalue.
-
- wells> So that I don't have to go out and buy an asbestos suit, I
- wells> want to make it very clear that I would never even consider
- wells> writing code like this.
-
- Why not ? It's a nice shortcut in some situations, and nobody with
- some knowledge of C should have problems reading the code.
-
- bye -- Thomas
-