sizeof (int) - 1

grayson at uiucuxc.CSO.UIUC.EDU grayson at uiucuxc.CSO.UIUC.EDU
Mon Sep 29 07:29:00 AEST 1986


It is interesting that the expression
	sizeof (int) - 1
is ambiguous in C, for it can be parsed as
	sizeof ((int)(- 1))
or as
	(sizeof(int)) - 1

Think about it!

The unix compiler does it the second way, for when it sees the '-' it
sets the precedence for that character ASSUMING it will be used as a
binary operator.



More information about the Comp.lang.c mailing list