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.
- I thought that the members of a structure or union are called its fields. So what is a non-field member of a structure or union? How is it different from a field member?
- Can you explain "A non-field member of a structure or union may have any object type" with some examples?
- Does the second sentence in the quote mean that a field member can only have type int, unsigned int, or signed int?
- The last sentence in the quote mentions that a non-field member is aligned. Is a field member aligned? If not, how is a field member stored in memory?
Thanks.