Binary Constants (0b)

It is as well possible to use the binary notation for constants instead of hexadecimal constants or normal constants. Note that binary constants are not allowed if the -Ansi: Strict ANSI compiler option is switched on. Binary constants start with the 0b prefix, followed by a sequence of zeros or ones.

Listing: Demonstration of a binary constant
#define myBinaryConst 0b01011

int i;

void main(void) {

i = myBinaryConst;

}