increment casted void pointer -- ANSI?

Doug Gwyn gwyn at smoke.brl.mil
Wed Mar 27 08:22:11 AEST 1991


In article <288 at nazgul.UUCP> bright at nazgul.UUCP (Walter Bright) writes:
-In article <1991Mar8.165300.11692 at zoo.toronto.edu> henry at zoo.toronto.edu (Henry Spencer) writes:
-/There is no way to say "pretend this variable has a different type" in C.
-/Casts are conversions, not "view this bit pattern differently" operators
-The usual to do a 'type paint', which is to change the type of an object
-without changing the bit pattern, is to:
-	*(newtype *)&(object)

A strictly conforming method is to use a union type.



More information about the Comp.lang.c mailing list