J
James Brown
All,
Suppose I have the following enum and structure definitions:
enum e
{
ename1, ename2, ename3, ename4
};
struct s
{
int ibitfield : 20;
enum e ebitfield : 2;
};
My question is - can I mix 'int' and 'enum e' in a bitfield in this manner?
I suspect the answer is yes but don't fully trust my compiler (VC6). I
think also that as long as I reserve enough bits for 'ebitfield' which will
hold all possible values of the enumeration (2 bits = 4, in this case) then
this is also ok?
TIA,
James
Suppose I have the following enum and structure definitions:
enum e
{
ename1, ename2, ename3, ename4
};
struct s
{
int ibitfield : 20;
enum e ebitfield : 2;
};
My question is - can I mix 'int' and 'enum e' in a bitfield in this manner?
I suspect the answer is yes but don't fully trust my compiler (VC6). I
think also that as long as I reserve enough bits for 'ebitfield' which will
hold all possible values of the enumeration (2 bits = 4, in this case) then
this is also ok?
TIA,
James