In C I'm reading a string from a txt file, for example the string "hello", so i have my:
F=fopen("text.txt","r");
fscanf(F,"%s\n",string);
Now, if i want to convert this string to hex and decimal, i can do something like this:
for (i=0; i<strlen(string); i++)
{
sprintf(st, "%02X", string[i]); //Convert to hex
strcat(hexstring, st);
sprintf(st, "%03d", string[i]); //Convert to dec
strcat(decstring, st);
}
Now, my question is: i want to do the inverse operation, but how? This is the output if i convert "hello"
hex-> 68656c6c6f
dec-> 104101108108111
From "68656c6c6f" or "104101108108111" i want to go back to "hello", how can i do this?
(basically i want to do something like this website: http://string-functions.com/; String To Hex Converter, Hex To String Converter, Decimal To Hex, Converter, Hex To Decimal Converter)