Réponse acceptée !
DWORD __stdcall HexaToDecimal(const char* pszHexa) { DWORD ret = 0, t = 0, n = 0; const char *c = pszHexa; while(*c && (n < 16)) { 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; n++; ret *= 16; ret += t; c++; if(n >= 8) break; } return ret; }
float f = (float) (int) HexaToDecimal(pszChaineHexa);
ciao... BruNews, MVP VC++
|