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

Q

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

✍: Guest

A

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, .

2015-02-13, 1284👍, 0💬