maart@cs.vu.nl (Maarten Litmaath) (08/03/90)
In article <kai4=Fi00Ug7E7alJa@andrew.cmu.edu>, jpab+@andrew.cmu.edu (Josh N. Pritikin) writes: )>> 1. That in C, a= +1 and a=+ 1 are different. )... )I believe that the first example was in reference to the old C syntax. )Now in C, whitespace doesn't change meaning, anywhere. Ahum. foo = a+++b; vs. foo = a+ ++b; -- "UNIX was never designed to keep people from doing stupid things, because that policy would also keep them from doing clever things." (Doug Gwyn)
KPURCELL@LIVERPOOL.AC.UK (08/06/90)
>Ahum. > foo = a+++b; >vs. > foo = a+ ++b; Of course you could write: foo = ++a+++++b++; and confuse a lot of people (and compilers!) Kevin
jonb@specialix.co.uk (Jon Brawn) (08/08/90)
KPURCELL@LIVERPOOL.AC.UK writes: >Of course you could write: > foo = ++a+++++b++; I prefer *++*++av to whip the flags out of the command line arguments (I know its not robust, only works for one flag at a time, etc. and I should be using getopts anyway, BUT it is short & punchy). -- Jon Brawn, Specialix, 3 Wintersells Road, Byfleet, Surrey, KT14 7LF, UK. Tel: +44(0)9323-54254, Fax:+44(0)9323-52781, jonb@specialix.co.uk or: {backbone}!mcsun!ukc!slxsys!jonb ``Once upon a time, not so very long ago, in a land, not so very far away''
hp@vmars.tuwien.ac.at (Peter Holzer) (08/08/90)
KPURCELL@LIVERPOOL.AC.UK writes: >Of course you could write: > foo = ++a+++++b++; >and confuse a lot of people (and compilers!) ^^^^^^^^^^^^^^ They surely are confused by this piece of non-C code: The above code is equivalent to: foo = ((++a)++)++ + b++; (++ a) is not an l-value; so (++ a)++ is not valid C. Any compiler accepting this code is broken. Regards, Peter -- | _ | Peter J. Holzer | Think of it | | |_|_) | Technische Universitaet Wien | as evolution | | | | | hp@vmars.tuwien.ac.at | in action! | | __/ | ...!uunet!mcsun!tuvie!vmars!hp | Tony Rand |
berg@cip-s02.informatik.rwth-aachen.de (AKA Solitair) (08/09/90)
In article <7219@star.cs.vu.nl> maart@cs.vu.nl (Maarten Litmaath) writes: >In article <kai4=Fi00Ug7E7alJa@andrew.cmu.edu>, > jpab+@andrew.cmu.edu (Josh N. Pritikin) writes: >)>> 1. That in C, a= +1 and a=+ 1 are different. >)... >)I believe that the first example was in reference to the old C syntax. >)Now in C, whitespace doesn't change meaning, anywhere. > >Ahum. > foo = a+++b; >vs. > foo = a+ ++b; What about: foo=a /*b;/**/; versus: foo=a/ *b;/**/; But I *love* C anyway! -- Sincerely, berg%cip-s01.informatik.rwth-aachen.de@unido.bitnet Stephen R. van den Berg. "I code it in 5 min, optimize it in 90 min, because it's so well optimized: it runs in only 5 min. Actually, most of the time I optimize programs."