C Interview Questions and Answers


Can I use base-2 constants (something like 0b101010)? Is there a printf format for binary?

No, on both counts, although there are various preprocessor tricks you can try.
You can convert base-2 string representations to integers with strtol. If you need
to print numbers out in base 2, .

Posted by:Richards