Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!olivea!uunet!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!pacbell.com!ucsd!hub.ucsb.edu!ucsbuxa!6600tom From: 6600tom@ucsbuxa.ucsb.edu (Thomas Kwong) Newsgroups: comp.lang.c Subject: Re: Efficiency Question Message-ID: <9454@hub.ucsb.edu> Date: 26 Feb 91 19:07:08 GMT References: <4bmBqau00Uh_M0aHgb@andrew.cmu.edu> Sender: news@hub.ucsb.edu Lines: 39 In article <4bmBqau00Uh_M0aHgb@andrew.cmu.edu> rg2c+@andrew.cmu.edu (Robert Nelson Gasch) writes: >Since C gives you the opportunity to condense statements, I was wondering >what difference to the compiler these 'shortcuts' make. >For example, you can write: > if (x > y) > z = x; > else > x = y; ^^^^^ >The same thing can be expressed like this: > z = (x > y) ? x : y; Nope. It should be if (x > y) z = x; else z = u; -Thomas. ============================================================ o | * ------------------------- ----- |- * tomkwong@cs.ucsb.edu \/ | * 6600tom@ucsbuxa.ucsb.edu -------- -- * ------------------------- __ | * | | |-- * "The more one think he knows, |--| |-- * the less he knows." |--| |-- * -Menocchio | | |-- * "Are you proud of being Chinese?" \| ------\ * I say, "Sure, always!" :-) ============================================================ -- Thomas. ============================================================