It would be easier, and probably better, to use strtol, strtoul, or even sscanf, if you ask me.
Did you have a question about the code?
Dave Sinkula
long time no c
5,058 posts since Apr 2004
Reputation Points: 2,780
Solved Threads: 314
#include<stdio.h>
int main()
{
char sh[100] = "ED",*stop;
int test;
test = strtol(sh,&stop,16);
printf("Test:%d",test);
}
Very nice. I assume it works now...
WaltP
Posting Sage w/ dash of thyme
10,506 posts since May 2006
Reputation Points: 3,348
Solved Threads: 944