{* *}
code teams

Hex To Dec



int HexToDec (char* ptr)
{
    int j;
    int tmp = 0;

    for ( j=0; j<4; j++, ptr++) {
        tmp = tmp << 4;
        if ((*ptr >= '0') && (*ptr <= '9'))
            tmp += *ptr - '0';
        else if ((*ptr >= 'a') && (*ptr <= 'f'))
            tmp += *ptr - 'a' + 10;
        else
            tmp += *ptr - 'A' + 10;
    }
    return (tmp);
}