TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: ANTHONY TIBBS
from: ALEXANDER DERAZHNE
date: 1997-05-01 01:04:00
subject: About bit-field syntax

Hello, dear Anthony!
Friday April 18 1997 16:47, Anthony Tibbs wrote to Alexander Derazhne:
[...]
 AT> Actually, if I understand this right, it is doing this properly.  The
 AT> unsigned int only requires one byte of memory when using bitfields.
 AT> If you used:
 AT> struct A {unsigned int x, y, z;};
 AT> struct B {unsigned int x, y, z;};
 AT> Then yes, the compiler is wrong.
    No, I'm just lose sight that
struct A { unsigned int x : 1,              y : 2,              z: 5; };
and
struct B { unsigned int x : 1; unsigned int y : 2; unsigned int z : 5; };
are identical, like
struct C { unsigned int X, Y, Z; };
and
struct D { unsigned int X; unsigned int Y; unsigned int Z; };
:-(.
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™.