Page 124 - 6437
P. 124

unsigned int type:4;

                              unsigned int my_int:9;

                            } pack;

                          Here, the packed_struct contains 6 members: Four 1 bit flags f1..f3, a 4-bit type, and a 9-
                   bit my_int.
                          C automatically packs the above  bit  fields as compactly  as possible, provided that the
                   maximum length of the field is less than or equal to the integer word length of the computer. If
                   this is not the case, then some compilers may allow memory overlap for the fields, while others
                   would store the next field in the next word.



































































                                                                                                     127
   119   120   121   122   123   124   125   126   127   128   129