projects
/
my-code
/
beginners.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
added string2hex prog (usefull for wep key)
[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