标签:ar for sp c r amp bs c++ res
int BetterVenca25(char* hex)
{
int res=0;
for(;*hex;hex++)
{ int d=toupper(*hex);
if(d >=‘0‘ && d <=‘9‘)d-=‘0‘;
else
if(d >=‘A‘ && d <=‘F‘)d-=‘A‘-10;
else return -1;
res=res*16+d;
}
return res;
}
标签:ar for sp c r amp bs c++ res
原文地址:http://www.cnblogs.com/lidabo/p/4012274.html