Possible Duplicate:
Can I use a binary literal in C or C++?
In C I can write
uint32_t a = 0x40022000;
using hex. Can I do something similar by entering binary digits?
Possible Duplicate:
Can I use a binary literal in C or C++?
In C I can write
uint32_t a = 0x40022000;
using hex. Can I do something similar by entering binary digits?
You can't do that with standard C, but some compilers such as gcc supports an extension that allows you to write something like
uint32_t a = 0b11010101110101;
This is not possible. In (ANSI) C you can enter either decimal, hexadecimal or octal digits. Use a converter to convert your binary number to a hex. A standard calculator with scientific capabilities should be enough.