I know that at least some implementations of printf()
(or sprintf()
etc.) support a %b
format specifier, which formats integral numbers using binary digits. But - this does not seem to be part of the language standard (according to cppreference).
So, which platforms / C-standard-library implementations support "%b"? And - can I test for this support?
I should mention libc6 on (fairly recent) Linux machines doesn't support %b
; and that's what you get with gcc and clang on Linux machines. But maybe on other Unix'es, or Windows, or embedded libc's of some kind etc.