I am trying to use strtol
to convert a hex value into a decimal. It has been verified as a valid hex value before in the program, and now I am trying to convert it, but it keeps printing "0" for most values.
int convert_hexadecimal_address(char *hexadecimal) {
printf("The character going in is %s\n", hexadecimal);
long hex_int = strtol(hexadecimal, NULL, 10);
printf("The long is %ld\n", hex_int);
return hex_int;
}
What is wrong with this code?