Newsgroups: comp.lang.c
Path: utzoo!henry
From: henry@utzoo.uucp (Henry Spencer)
Subject: Re: "address" of a bitfield
Message-ID: <1989Jul17.212555.24509@utzoo.uucp>
Organization: U of Toronto Zoology
References: <2840@blake.acs.washington.edu>
Date: Mon, 17 Jul 89 21:25:55 GMT

In article <2840@blake.acs.washington.edu> wiml@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@zoo.toronto.edu
