Assignment Ops and Side Effects

Brian Bliss bliss at sp64.csrd.uiuc.edu
Sat Apr 6 09:46:36 AEST 1991


> For the compiler that thinks that sizeof(c += 1) is sizeof(int),
> I wonder what it thinks about sizeof(c = 1) or sizeof(c = 1.0) ?
(c is a char)

The compiler is Sun 4.0's cc, and indeed, it returns 1 for both cases.
So indeed it is the assignment that is responsible for coercing
the result back to char type.

bb



More information about the Comp.lang.c mailing list