Binary Constants (0b)

Use 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 zeroes or ones.

Listing: Using Binary Constants
#define myBinaryConst 0b01011
  int i;

void main(void) {

  i = myBinaryConst;

}