how has C bitten you?

Ross M. Greenberg greenber at timeinc.UUCP
Fri Aug 16 02:01:34 AEST 1985


One that has bitten me on more occasions than I'm willing to
admit is difference in precedence operations:

Imagine transmitting a two byte checksum:

putc(highbyte, fd);
putc(lowbyte, fd);

and then reading it on the other side:

crc = (getch(fd) * 256) + getch(fd);


Different machines (compilers) do the two getch's in different orders.

-- 
------------------------------------------------------------------
Ross M. Greenberg  @ Time Inc, New York 
              --------->{vax135 | ihnp4}!timeinc!greenber<---------

I highly doubt that Time Inc.  would make me their spokesperson.
---



More information about the Comp.lang.c mailing list