Il y en a pour tout si on l'écrit:
DWORD __stdcall HexaToDecimal(const char* pszHexa) { DWORD ret = 0, t = 0, n = 8, c; while(c = *pszHexa) { if((c >= '0') && (c <= '9')) t = (c - '0'); else if((c >= 'A') && (c <= 'F')) t = (c - 'A' + 10); else if((c >= 'a') && (c <= 'f')) t = (c - 'a' + 10); else break; ret *= 16; ret += t; pszHexa++; if(--n == 0) break; } return ret; }
ciao... BruNews, MVP VC++
|