Skip to content

Instantly share code, notes, and snippets.

@sukesan1984
Created February 10, 2020 04:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sukesan1984/38e735e8ff5bbae4b01a19699685d14d to your computer and use it in GitHub Desktop.
Save sukesan1984/38e735e8ff5bbae4b01a19699685d14d to your computer and use it in GitHub Desktop.
#include <unistd.h>
#include <stdio.h>
int main(void)
{
char hex_c = '\x63';
char oct_c = '\143';
char dec_c = 99;
fprintf(stdout, "16進数: \n");
write(1, &hex_c, 1);
write(1, "\n", 1);
fprintf(stdout, "8進数: \n");
write(1, &oct_c, 1);
write(1, "\n", 1);
fprintf(stdout, "10進数: \n");
write(1, &dec_c, 1);
write(1, "\n", 1);
return (0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment