A
Abhi
In ANSI C, we can have a bit fields inside structure like
struct _A {
int i:2;
};
would define a variable of 2-bit length. My doubt is that what would
the size of this structure then? Would it be sizeof(int) or just 1
byte? I know that it is quite compiler specific, but what it should be
according to the ANSI standard? I couldn't find exact documentation
explaining this.
Microsoft compiler does give sizeof(int) for such structure.
Regards,
-Abhishikt
struct _A {
int i:2;
};
would define a variable of 2-bit length. My doubt is that what would
the size of this structure then? Would it be sizeof(int) or just 1
byte? I know that it is quite compiler specific, but what it should be
according to the ANSI standard? I couldn't find exact documentation
explaining this.
Microsoft compiler does give sizeof(int) for such structure.
Regards,
-Abhishikt