Sunday, December 4, 2011

Enter 8-bit binary value in a char variable in C code?

for example:





unsigned char x = "00001000";|||C doesn't support binary constants so you'll have to find the hex, octal or decimal equivalent.





/*unsigned char x = 00001000*/


unsigned char x_decimal = 8;


unsigned char x_octal = 010;


unsigned char x_hex = 0x8;

No comments:

Post a Comment