Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!ccu.umanitoba.ca!herald.usask.ca!alberta!ubc-cs!uw-beaver!milton!dali.cs.montana.edu!uakari.primate.wisc.edu!samsung!spool.mu.edu!uunet!munnari.oz.au!brolga!bunyip.cc.uq.oz.au!lance!ptcburp!michi From: michi@ptcburp.ptcbu.oz.au (Michael Henning) Newsgroups: comp.lang.c Subject: Re: cond. op. on ='s LHS Message-ID: <326@ptcburp.ptcbu.oz.au> Date: 14 Feb 91 23:28:25 GMT References: <4155@cernvax.cern.ch> Organization: Pyramid Technology Corporation Lines: 26 burow@cernvax.cern.ch (burkhard burow) writes: >I'm wondering if anyone has any comments on using: > *(a==b?&c:&d) = 1; >instead of: > if (a==b) c=1; > else d=1; Yes, I do :-) If you compare the two above statements, the answer should be obvious. The second expression is perfectly clear and readable, whereas the first one takes some looking at to decipher. Besides, on many compilers, the first expression will take longer to run, since you are dereferencing a pointer there. Michi. -- -m------- Michael Henning +61 75 950255 ---mmm----- Pyramid Technology +61 75 522475 FAX -----mmmmm--- Research Park, Bond University michi@ptcburp.ptcbu.oz.au -------mmmmmmm- Gold Coast, Q 4229, AUSTRALIA uunet!munnari!ptcburp.oz!michi