un named bit fields

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • sophia

    un named bit fields

    Dear all,


    what exactly is the purpose of un named bit field such as this

    struct
    {
    int first_bit : 1;
    unsigned : 14;
    int last_bit : 1;
    } bf;


  • robertwessel2@yahoo.com

    #2
    Re: un named bit fields

    On Apr 16, 11:42 am, sophia <sophia.ag...@g mail.comwrote:
    Dear all,
    >
    what exactly is the purpose of un named bit field such as this
    >
    struct
    {
       int first_bit : 1;
       unsigned   : 14;
       int last_bit : 1;
    >
    >
    >
    } bf;

    Spacing. Presumably this structure maps onto some externally defined
    layout (given the details of how bit fields are implemented on this
    particular implementation) , and the ":14" defines a range of 14 unused
    (or uninteresting) bits.

    Comment

    Working...