Do you use bit fields? ( K&R p. 137-8 ) (YES!)

qwerty at drutx.UUCP qwerty at drutx.UUCP
Thu Sep 20 23:53:38 AEST 1984


We have used bit fields in dealing with hardware interfaces that are mapped
into non-byte or non-word segments (ie. a couple of bits here, five bits
there kind of things).  They have turned out to be very useful.  I have
also used them as a form of compressed storage where I needed a lot of
true/false states - you can get 16/32 to a word.  There can be significant
time wasted doing this if your underlying hardware does not support
bit testing/manipulation.



More information about the Comp.lang.c mailing list