`
izuoyan
  • 浏览: 8949117 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

库函数isdigit(char)不稳定

阅读更多

在c++库里面有个bool isdigit(char)函数,用来判断某个字符是不是数字[0~9] ,但是在实际系统中使用时发现,它的功能是不稳定的,建议不要使用,需要时,可以自己写一个。

比如 我自己写的

bool IsDigit(char ch){

if((ch >=48)&&(ch<=57))//ascii码 '0'=48 '9'=57

return true;

else

return false;

}

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics