Any GOOD reason for C's behaviour i

robison at uiucdcsb.CS.UIUC.EDU robison at uiucdcsb.CS.UIUC.EDU
Thu Jul 24 11:08:00 AEST 1986


Your compiler is broken according to K&R, section 2.7 (page 42): 

``In the construction

	(type-name) expression

the expression is converted to the named type by the conversion rules above.
The precise meaning of a cast is in fact as if expression were assigned to a
variable of the specified type, which is then used in place of the whole 
construction.''

Your two programs should behave identically.

Arch D. Robison
University of Illinois at Urbana-Champaign



More information about the Comp.lang.c mailing list