If i declare an enum as follows:
typedef enum A { a = 0x00000001, b = 0x00000002 } AObj;
Now if i declare a variable of AObj as follows what does this mean?
AObj myAObj : 2;
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It is a way of specifying the number of bits used. That is 2 means 2 bits.
Also note that this is only useful when used with other bit fields in the same struct as alignment and padding will cause the memory to be skipped.