Quote:
|
Originally Posted by sciguy125
Does anyone know if it's possible to use binary numbers in C? Of course, it's just to make it easier to read the source. I'm doing some bitwise operations and 218 or 0xDA just isn't as meaningful as 11011010.
|
I don't believe the C standards have any support for entering numbers in binary. Just use hex - it'll be awkward for a bit but after a while you'll be able to read hex and "see" the binary without any trouble. Binary becomes cumbersome when you start talking about 16 and 32 bit (and larger) numbers too.
Most people who write a lot of software will tell you that 0xDA is much easier to read than 11011010.