int _tmain(int argc, _TCHAR* argv[])
{
int HexToDec(char *shex)
{
int i,mid,val;
int len = strlen(shex);
if(len>8)
return FALSE;
mid = 0;
int idec = 0;
for(i=0;i<len;i++ )
{
if( shex[i]>='0' && shex[i]<='9' )
mid = shex[i] - '0';
else if( shex[i]>='A' && shex[i]<='F')
mid = shex[i] - 'A' + 10;
else if( shex[i]>='A' && shex[i]<='F')
mid = shex[i] - 'A' + 10;
else
return -1;
mid <<= ((len-i-1)<<2);
idec |= mid;
}
return idec;
}
val=HexToDec('FA');
cout<<val;
return 0;
}