#include <stdio.h>
struct {
short a : 2;
short b : 15;
char c;
}abc;
int main() {
printf("%d",sizeof(abc));
return 0;
}
The total size of "abc" is 4 bytes but when printed it is 6 bytes ?
I still don't understand why the size of abc is 6 bytes, **padding bytes**
are inserted between which members
of the struct
?
How many bytes each CPU cycle
reads?
Thanks for your respond