void main()
{
struct bitfield
{
signed int a :3;
unsigned int b :13;
unsigned int c :1;
};
struct bitfield bit1 = { 2, 14, 1 };
clrscr();
pr
How bit-field is stored in memory is implementation dependent.
One possible reason is, the bit-field which has 17 bits, should hold at least 3 bytes, but the compiler choose to pad it to 4 bytes.
Again, almost everything about bit-field is implementation dependent, including the size of them and memory layout.
Last, don't use void main
, always stay with int main