C++博客-I need time----------------> Hsssssss@C++-最新评论http://www.cppblog.com/dotaqop/CommentsRSS.aspx每天进步一...................................zh-cnSat, 15 Oct 2011 11:25:01 GMTSat, 15 Oct 2011 11:25:01 GMTcnblogsre: 用面向对象语言实现一个计算器控制台程序http://www.cppblog.com/dotaqop/archive/2011/08/12/153193.html#153237HsssssssHsssssssFri, 12 Aug 2011 14:16:00 GMThttp://www.cppblog.com/dotaqop/archive/2011/08/12/153193.html#153237

Hsssssss 2011-08-12 22:16 发表评论
]]>
re: 将16进制字符串转换成10进制数http://www.cppblog.com/dotaqop/archive/2011/07/13/148412.html#150827xuorc1986xuorc1986Wed, 13 Jul 2011 02:26:00 GMThttp://www.cppblog.com/dotaqop/archive/2011/07/13/148412.html#150827{
int result = 0;
int decnum = 0;
int i = 0;
int length = strlen(str);

do
{
if(str[i]<='9'&&str[i]>='0')
decnum=str[i]-'0';
else if(str[i]<='f'&&str[i]>='a')
decnum=str[i]-'a'+10;
else if(str[i]<='F'&&str[i]>='A')
decnum=str[i]-'A'+10;
else{
return result;
}
result <<= (i << 2);
result += decnum;

} while (i++ < length);

return result;
}

xuorc1986 2011-07-13 10:26 发表评论
]]>