David d'Angers said:
hi group
i read this in the linux version "tree" program
struct _info {
char *name;
char *lnk;
u_char isdir : 1;
Look up "bitfield" or "bit-field" in your C reference book. Bitfields are
sometimes used when a direct mapping to hardware bits is desired, but this
usage is inherently non-portable (not least because which way round the
bits go depends on the implementation). They are also sometimes used,
rather more portably, in an attempt to pack more than one numeric value
into a byte or group of bytes.
There is much more to be said about bitfields (mostly bad!, in my opinion),
but I think this short answer does at least address your question
sufficiently to enable you to discover more about them for yourself.
--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999