0

Possible Duplicate:
Can I use a binary literal in C or C++?

In C or C++ we can do:

const int i = 0x1B; // hexadecimal
const int i = 27;   // decimal
const int i = 033;  // octal

But there is no form to write const int i = 0b00011011 or anything of this form.

Sometimes bit masks are I think much more readable than octal or hexadecimal representation.

Any trick for that?

Thank you.

Community
  • 1
  • 1
Benoit
  • 73,313
  • 23
  • 201
  • 230

0 Answers0