int my_strlen(char *str); char *mymy_revstr(char *str) { int i; char c; int l; i = 0; l = my_strlen(str) - 1; while (i < (l / 2)) { c = str[i]; str[i] = str[l - i]; str[l - i] = c; i++; } return (str); } char *dec2bin(int nb) { char *res; int i; i = 0; res = malloc(nb * sizeof(res)); while (nb) { res[i] = nb % 2 + 48; nb /= 2; i++; } // res[i] = '\0'; return ((res)); } int main(int argc, char **argv) { // my_putstr(dec2bin(my_getnbr(argv[1]))); my_putstr(mymy_revstr("uosib")); }