I have a single hexadecimal character, say
char c = 'A';
What’s the proper way of converting that to its integer value
int value =??;
assert(a == 10);
Doesn’t matter really for now if a is an int or a byte.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
i don’t see why you should have to convert to string… in fact this is what parseInt uses:
public static int digit(char ch, int radix)