Why is this code:
#include <iostream>
struct S {
unsigned char a:6, b:6, c:6, d:6;
};
int main(int argc, char *argv[]) {
std::cout << sizeof(S);
return 0;
}
returning 4? Shouldn't it have a size of 4 x 6 = 24b = 3B? In contrast, this code:
struct S { unsigned char a:4, b:4, c:4, d:4; };
returns a 2, while this one:
struct S { unsigned char a:4, b:4, c:4, d:4, e:4, f:4; };
returns a 3...