If the string represents an hex number you can use this code:
unsigned int atoin(char s[])
{
int i;
unsigned int n;
n = 0;
i=0;
while(s[i]!='\0'){
//for (i = 0; s[i]!='\0'; i++){
if ((s[i] >= '0') && (s[i] (minor)= '9')){
n = (16 * n) +(s[i] - '0');}
else{
n = (16 * n) +(s[i] - 'A' + 10);}
i++;
}
return n;
}mudy