2

Today, I saw an example in this website which was new to me. The provided example is as follow:

struct S {
    char a;     // memory location #1
    int b : 5;  // memory location #2
    int c : 11, // memory location #2 (continued)
          : 0,
        d : 8;  // memory location #3
    struct {
        int ee : 8; // memory location #4
    } e;
} obj; // The object 'obj' consists of 4 separate memory locations

I'm a little bit confused about the ':' in this example, what does "int b : 5;" mean in this example?

Al.G.
  • 4,327
  • 6
  • 31
  • 56

0 Answers0