Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!tut.cis.ohio-state.edu!ucsd!hub!6600pete From: 6600pete@ucsbuxa.ucsb.edu Newsgroups: comp.lang.c Subject: Re: This one bit me today Message-ID: <2564@hub.UUCP> Date: 17 Oct 89 04:35:07 GMT References: <832@crdos1.crd.ge.COM> <192700007@hollin> Sender: news@hub.UUCP Reply-To: pete@cavevax.ucsb.edu Organization: University of California -- Santa Barbara Lines: 16 In-reply-to: ds@hollin.prime.com's message of 16 Oct 89 21:07:00 GMT In article <192700007@hollin> ds@hollin.prime.com writes: I could never get used to the difference between = and ==, so I use "#define EQ ==" (and "#define NE !=" for symmetry) as part of my standard defines at the start of every program. While the lexical distinction remains, it is now reflected more thoroughly by the difference between punctuation and alphabetical characters. Another good way to do this, at least when comparing to a constant, is to put the constant first in an expression, like so if ( 1 == x ) { No C compiler will accept if ( 1 = x ) {