Code:
int ctoi(char source)
{ /* Converts a character 0-9 to its equivalent integer value */
if((source >= '0') && (source <= '9'))
return (source - '0');
return(source - 'A' + 10);
}
char itoc(int source)
{ /* Converts an integer value to its hexadecimal character */
if ((source >= 0) && (source <= 9)) {
return ('0' + source); }
else {
return ('A' + (source - 10)); }
}
I don't understand what thes function are doing - convert character to
ASCII code and back to character? Nope, I tried Ord/Chr and result was bad. WTF mean number + character statement
?
How to in Delphi? Please?