Created
April 12, 2020 11:22
-
-
Save jonohayon/ea288d41f67ca769ba1dae15cf7bdc26 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
char *octalfive(unsigned int num) { | |
char *repr = (char *) malloc(BINARY_REPR_LEN * num); | |
unsigned int len; | |
sprintf(repr, "%05o", num); | |
len = strlen(repr); | |
memmove(repr, repr + (len - 5), 5); | |
return realloc(repr, 5); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment