atoi和stoi

vs环境下:
stoi函数默认要求输入的参数字符串是符合int范围的[-2147483648, 2147483647],否则会runtime error。
atoi函数则不做范围检查,若超过int范围,则显示-2147483648(溢出下界)或者2147483647(溢出上界)。
stoi头文件:<string>,c++函数
atoi头文件:<cstdlib>,c函数

引自https://blog.csdn.net/acm_1361677193/article/details/52740542

猜你喜欢

转载自www.cnblogs.com/dhfly/p/10457872.html