So I was working with bit fields, when I started thinking that when you create a bit field, for example
struct bit_field{
unsigned int just_a_bit : 1;
unsigned int five_bits : 5;
unsigned int : 3; //Fill to 8 bits
}
You use unsigned int variable : bits;
, what is this called (so I can search it)? Can this be used outside of creating bit fields, and would there be any point in doing so?
For clarity, by "this" I mean using colon with size in bits after the variable name whilst creating a variable.