struct status
{
int read : 1 ;
int write : 1 ;
int rd_wt : 1 ;
} ;
Ans: The size of the above structure is one byte. The structure consists of three integer member variables hence we assume the size of the structure would be 6 bytes but when we execute it shows 1 byte. The number following the members in the structures separated through colons are called bitfields which specify the size of the member in bits. Even though we mentioned the type int but only the bits are reserved for the member. Hence for each member of the structure one bit will be reserved and the size of structure becomes three bits but as the fundamental unit of addressing is a byte, it reserves 1 byte in memory.