Original Post
Why is it with a struct like this:
struct X
{
unsigned int MyBitField : 3;
};
and code like this:
cout << sizeof( MyBitField ) << endl;
gives me an output of "4" instead of "1" (with VC 6 at least).
There is a set of bits and values (of say 3 to 10 bits) packed into a couple of words that I want to access and manipulate. This seems like a great way to do it, but it looks like it won''t work. Or will it?