Saturday, December 17, 2011

Unsigned char initializing?

i want to set everybit of unsigned char 1 byte variable to 1 to get binary value 255 .How to initialize that?|||It's really as easy as it looks.





unsigned char c = 255;





Or you perform a bitwise negation of 0:





unsigned char c = ~0;

No comments:

Post a Comment