Maybe you want something like void s_to_b(const char*s) { if (s != NULL) { while ( *s) { int c = *s; printf(" %d", ...
stackoverflow.com