TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: HERMAN SCHONFELD
from: ALEXANDER DERAZHNE
date: 1997-03-26 20:20:00
subject: Bit Fields

Hello, dear Herman!
Sunday March 23 1997 09:15, Herman Schonfeld wrote to Rick Bischoff:
 RB>> Does anyone know how to declare a variable that holds only one bit
 RB>> of information.. (You know only two values (0 or 1)) ???
 HS> struct  bit_field {
 HS>         int bit_1        : 1;
                                 ^
 HS>         int bits_2_to_5  : 4;
             ^^^                 ^
 HS>         int bit_6        : 1;
             ^^^                 ^
 HS>         int bits_7_to_16 : 10;
             ^^^
 HS> } bit_var;
    I'm afraid, it wrong. First three lines requred comma (',') instead of
semicolon (';'), then, type declarations ("int") in last lines must be 
sent.
Alexander
--- GoldED/2 2.50+
---------------
* Origin: Frankenstain Point (2:463/16.100)

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™.