这段代码什么意思
wmtty 2007-04-06 01:44:20 int CUtil::Str2Num(CString str)
{
int num,len, shift;
int temp;
num = temp = 0;
len = str.GetLength();
for ( int i=0; i<len; i++ )
{
shift = len-i-1;
temp = str[i];
if (temp>='0' && temp <='9')
{
temp -= '0';
}
else if (temp>='A'&&temp<='F')
{
temp -= 0x37;
}
else
{
return 0;
}
while(shift--)
{
temp = temp <<4;
}
num += temp;
}
return num;
}