\"If you can read this you are too close.\" << Eh?
\"How long did it take you to learn hex?\" << Like 2 sec
#include
#include
#include
// Thanks aarobber
int HexToInt(char hex)
{
if (hex >= \'0\' && hex <= \'9\')
return (hex - \'0\');
if (hex >= \'A\' && hex <= \'F\')
return (hex - \'A\' + 10);
if (hex >= \'a\' && hex <= \'f\')
return (hex - \'a\' + 10);
return 0;
}
int main()
{
char str[] = \"49 66 20 79 6f 75 20 63 61 6e 20 72 65 61 64 20 74 68 69 73 20 79 6f 75 20 61 72 65 20 74 6f 6f 20 63 6c 6f 73 65 2e\\0\";
//char str[] = \"48 6F 77 20 6C 6F 6E 67 20 64 69 64 20 69 74 20 74 61 6B 65 20 79 6F 75 20 74 6F 20 6C 65 61 72 6E 20 68 65 78 3F\";
char* tok = strtok(str,\" \");
while( tok != NULL)
{
char t1 = tok[0];
char t2 = tok[1];
int total = (HexToInt(t1) << 4) + HexToInt(t2);
printf(\"%c\",(char)total);
tok = strtok(NULL,\" \");
}
return 0;
}
xD
Anyway, thanks for the encourgement. Without fans this wouldn\'t be half as fun to develop :)