N
Nikolay Moskvichev
Hello All.
size of this bit_field is 2 for gcc or borland, and 4 for msvc 2008
and 2010.
Can you please explain me this behaviour?
#include <iostream>
#pragma pack(push,1)
struct bit_field {
unsigned f1 : 5;
unsigned f2 : 4;
unsigned f3 : 7;
};
#pragma pack(pop)
int main()
{
std::cout<<sizeof(bit_field)<<std::endl;
}
Thanks.
size of this bit_field is 2 for gcc or borland, and 4 for msvc 2008
and 2010.
Can you please explain me this behaviour?
#include <iostream>
#pragma pack(push,1)
struct bit_field {
unsigned f1 : 5;
unsigned f2 : 4;
unsigned f3 : 7;
};
#pragma pack(pop)
int main()
{
std::cout<<sizeof(bit_field)<<std::endl;
}
Thanks.