c programming style - READ THIS

Guy Harris guy at sun.uucp
Fri Aug 16 18:46:21 AEST 1985


> > > Well, you should know that `++' and `--' *ONLY* works on variables of
> > > type scalar, where a there is a defined successor or predecessor
> > 
> > No, I didn't know that.  Then again, neither did Kernighan nor Ritchie.
> 
> Ritchie, did... since the Ritchie 'C' compiler complains about (float)++,
> claiming it's not a scalar (or words to that effect).

Well, then, he must have changed his mind at some point, considering that
K&R says "++<something>" is the same as "<something> += 1".  As you'd have
known if you'd read the article you were replying to, the article was
referring to K&R not to a particular compiler written by R; the former may
not be a great standard but it's a lot closer to a standard than the
behavior of one particular compiler.

	Guy Harris



More information about the Comp.lang.c mailing list