I can print with printf as a hex or octal number. Is there a format tag to print as binary, or arbitrary base?
I am running gcc.
printf(\"%d %x %o
const char* byte_to_binary(int x) { static char b[sizeof(int)*8+1] = {0}; int y; long long z; for (z = 1LL< 0; z >>= 1, y++) { b[y] = (((x & z) == z) ? '1' : '0'); } b[y] = 0; return b; }