"address" of a bitfield

Henry Spencer henry at utzoo.uucp
Tue Jul 18 07:25:55 AEST 1989


In article <2840 at blake.acs.washington.edu> wiml at blake.UUCP (William Lewis) writes:
>  which would assign to 'start' the (char *) pointing to the start of the
>bitfield, to 'offset' the number of bits into the char the bitfield starts,
>and to 'width' the width of the bitfield in bits...
>    Does anyone know of an even semi-portable way to do this? ...

Can't be done -- the packing of bitfields into words/chars/whatever is
highly machine-specific (even the order, left-to-right or right-to-left,
varies) and the information is not available to the program.
-- 
$10 million equals 18 PM       |     Henry Spencer at U of Toronto Zoology
(Pentagon-Minutes). -Tom Neff  | uunet!attcan!utzoo!henry henry at zoo.toronto.edu



More information about the Comp.lang.c mailing list