The field part of bit-fields seems to suggest that they can only be fields inside a structure or union.
Can a bit-field be a typical "stand-alone" variable, outside any aggregate data-type like union or structure as follows:
int sum:6; //Can this work as a declaration statement?
sum=4;
If not, why so? If bit-fields are basically intended to use less memory, why can't we declare any variable as a bit-field if we know it won't exceed that size?
See Question&Answers more detail:os