把字符转换成值相同的整数需要用字符减去字符’0’ 往往这里的转换还需要用到isdigit函数进行if判断,isdigit(s)作用检查s是否是数字0到9 char a = '1'; int b = a - '0' ; 相关资料