Could we see what you have so far?
gerard4143
Nearly a Posting Maven
2,272 posts since Jan 2008
Reputation Points: 512
Solved Threads: 387
So far I have my C file taking in 2 characters:
char char1, char2;
printf ("Enter a character: ");
scanf ("%c", &char1);
while (getchar () != '\n')//so that the program doesn't take in the carriage return as input
continue;
printf ("Enter another character: ");
scanf ("%c", &char2);
while (getchar () != '\n')//so that the program doesn't take in the carriage return as input
continue;
And I'm just not sure how to verify if their HEX or just normal characters (so either 0-9 or A-F). I was thinking I could just do a bunch of if statements comparing each of them (or make a HEX array, and for loop through it comparing along the way), but is there a better way to do this?
C has a function called isxdigit which checks if the character is 0 -9 or a - f maybe you could use that...
gerard4143
Nearly a Posting Maven
2,272 posts since Jan 2008
Reputation Points: 512
Solved Threads: 387