Johpoke wrote:
i can do int data = 0xF; but how do i do the same thing with binary?
In short: you can't. You may write integer values in your source code using decimal, octal or hexadecimal notation. For decimal notation you have no prefix and use digits from 0 to 9, e.g. 255. For octal notation you prefix the number with '0' and use digits from 0 to 7, e.g. 0377. For hexadecimal notation you prefix the number with '0x' and use digits from 0 to F, e.g. 0xFF. Each example represents the same value but with different notations. Regarding how to read and interpret the hexadecimal notation... Each digit represents four bits, a nibble, which can hold values between 0 and 15. You simply have to get it into your spinal cord how to represent a nibble using the different notations, e.g. that 1100 in binary equals 0xC in hex which equals 12 in decimal.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"High speed never compensates for wrong direction!" - unknown