projects
/
my-code
/
beginners.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
5042af63cffd79e7e270e8fe7245fb408e95c340
[my-code/beginners.git]
/
h2i-calc.c
1
#include <stdio.h>
2
#include <stdlib.h>
3
4
int main(int argc,char *argv[]) {
5
char hex_char[10];
6
sprintf(hex_char,"0x%s",argv[1]);
7
printf("%s (dec) -> %x (hex)\n",argv[1],atoi(argv[1]));
8
printf("%s (hex) -> %ld (dec)\n",argv[1],strtol(hex_char,NULL,0));
9
return 1;
10
}
11