long htoi(char *str)
{
long dec=0, t;
if(*str=='0') str+=2;
while(t=*str++)
{
dec<<=4;
if(t<58) t-=48;
if(t>64&&t<71) t-=55;
if(t>96&&t<103) t-=87;
dec|=t;
}
return dec;
}
全站熱搜