1

I'm working with a piece of code and I come across with something similar to this:

struct {
  int a : 1;
  int b : 1;
};

I don't know what is the function of : 1 here. For your interest, that struct is inside a union which in turn is inside a typedef struct.

Thanks,

ferdepe
  • 510
  • 1
  • 6
  • 21

1 Answers1

0

This is used to assign value to a bit. You can read about bitfields here.

Marievi
  • 4,951
  • 1
  • 16
  • 33