Hi all,
I make a fair bit of use of bitflags in my code
eg.
struct { unsigned char bit0 : 1; unsigned char bit1 : 1; ... unsigned char bit7 : 7; }bitbyte1,bitbyte2;
Sometimes I wish to know if the flags are ALL CLEAR to save time.
I have tried the following
if(bitbyte1!=0) ;test which bit is set else do no tests at all
,but it throws up a compiler error
error: invalid operands to binary == (have 'volatile struct' and 'int')
I have not come up with an elegant way of doing this!.
Any thoughts on how I can avoid a compound if statement.
[/code]