TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: RICK BISCHOFF
from: JERRY COFFIN
date: 1997-03-23 11:28:00
subject: Bit Fields

On (20 Mar 97) Rick Bischoff wrote to All...
 RB> Does anyone know how to declare a variable that holds only one bit of
 RB> information.. (You know only two values (0 or 1)) ???
It can only be done when the variable is a member of a struct, class or
union.
struct something {
    unsigned whatever: 1;
    unsigned something: 2;
};
You usually want a 1 bit variable to be usigned: otherwise if the bit is
set your value might be either 1 or -1, depending on the compiler.  -1
is more common, but it's not guaranteed.
    Later,
    Jerry.
... The Universe is a figment of its own imagination.
--- PPoint 1.90
---------------
* Origin: Point Pointedly Pointless (1:128/166.5)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.