cancel
Showing results for 
Search instead for 
Did you mean: 

How to declare a bitfield without a name in a struct in Cosmic C?

davids
Associate II
Posted on April 17, 2007 at 05:51

How to declare a bitfield without a name in a struct in Cosmic C?

2 REPLIES 2
davids
Associate II
Posted on April 15, 2007 at 09:26

On page 3-9 of the ''C Language manual Rev. 1.1'' it says:

''A bitfield without name will be used to skip the corresponding amount

of bits in the allocation unit.''

I'm not sure how to do that. Take this example, I want to define a char as bbbxxaaa where I don't care about xx and it should just be skipped (ie a bitfield without a name):

struct {

char a:3;

char :2;

char b:3;

}

Did I do that right?

Thanks!

-David

luca239955_st
Associate III
Posted on April 17, 2007 at 05:51

that's correct.

Regards,

Luca (Cosmic)