Hello, I just want to code a binary data in C. I mean hera representation is "0x5F", the decimal representation is simply "156" but what is the decimal representation. I tried 0b010010101 but it doesn't work Many thanks Sébastien
The ANSI 'C' language does have a binary data notation. I suppose you could do something with the preprocessor if it's really important to you; eg,
#define B_0000_0000 0x00 #define B_0000_0001 0x01 #define B_0000_0010 0x02 #define B_0000_0011 0x03 #define B_0000_0100 0x04 etc #define B_1111_1101 0xfd #define B_1111_1110 0xfe #define B_1111_1111 0xff
When I said, "The ANSI 'C' language does have a binary data notation" what I meant was, of course, "The ANSI 'C' language does not have a binary data notation"