The role of the colon is to share the bits of bytes in order to save memory space.
int is usually 4 bits, but if we want to represent a state, only 0,1. we can use only 1 bit .
struct example {
int state1 : 1;
int state2 : 2;
int state3 : 1;
int state4 : 3;
};
state1,state2,state3 are in the same int data.