2 Answers
New Answermichal Bit fields (int a :1) are useful for saving on memory. It also provide direct access to individual bits without explicit bit extraction. The logic is if all you need is individual bits then why waste memory by defining integers. size of bit is 4 because it has one field of type int. And sizeof int is 4 bytes bit2 size is 4 instead of 8 because two bits easily fits into 1 integer, hence compiler will not allocate extra int
There are a series of posts of structure packing from C++ Soldier (Babak) user that explains this https://www.sololearn.com/post/78037/?ref=app