2003-05-11 11:28 PM
How to use binary numbers unstead of hex
2003-05-08 12:53 AM
Hi
How can I (if it is possible) do the following in C with a binary number instead of a hex number?Code:
unsigned char x; x= 01010101b; // binary number /Ulrich2003-05-08 01:39 AM
In Cosmic and metrowerks you would use:
unsigned char data; data = 0b00000000; Regards SJO2003-05-08 02:19 AM
Yes but it does not work. I get an error when compiling: C2704 - Illegal number
/Ulrich2003-05-08 07:38 AM
I have tested it in both cosmic and metrowerks with no problems ?
What compiler/version are you using? You are using 0b00000000 not 00000000b as per your example ? Regards SJO2003-05-11 09:33 PM
Hi again
I am using Metrowerks Codewarrior ver. 4.1 build 0621. I tried the method you suggested but still the same error. Regards, Ulrich2003-05-11 11:28 PM
I have checked my version and it is 4.2.5.766
Looks like you need to upgrade. Regards SJO