fourstar,
I read your program. As you stated that some calculations are needed - my suggestion for you to write such a function that convert string (numeric values) into int and vice versa.
__avd
Posting Genius (adatapost)
8,648 posts since Oct 2008
Reputation Points: 2,136
Solved Threads: 1,241
Ok thanks for the help. I got that part figured out now. It turns out I was using
if(isdigit(numIn[i]) == true)
and I shouldn't have been using
== true
Now I'm trying to figure out how to reject any input that is from "G"-"Z" as those aren't valid hexadecimal letters. Any help?
Ascii value of 'G' is 71. Ascii value of 'Z' is 90. Any character between 71 and 90, inclusive, is to be rejected.
char digit = 'J';
if (digit >= 71 && digit <= 90)
cout << "Illegal digit";
Have you considered using this function? http://www.cplusplus.com/reference/clibrary/cctype/isxdigit/
VernonDozier
Posting Expert
5,527 posts since Jan 2008
Reputation Points: 2,633
Solved Threads: 711