From K&R The C Programming Language:
A non-field member of a structure or union may have any object type.
A field member (which need not have a declarator and thus may be unnamed) has type int , unsigned int , or signed int , and is interpreted as an object of integral type of the specified length in bits; whether an int field is treated as signed is implementation-dependent.
...
A non-field member of a structure is aligned at an addressing boundary depending on its type; therefore, there may be unnamed holes in a structure.
Thanks.
A field member is nowadays called a bit field member:
int i : 3; // named bit-field member
int : 5; // unnamed bit-field member
int j; // non-bit-field member
const char *s; // non-bit-field member, non-integer type
When to use bit-fields in C?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With