atoi 函数
#include <stdio.h>#include <stdlib.h>
int main()
{
printf("%d\n", atoi("FishC123"));
printf("%d\n", atoi("123FishC"));
printf("%d\n", atoi(" 123"));
printf("%d\n", atoi("-123.45 "));
printf("%d\n", atoi("123456789999999999"));
return 0;
}
为什么最后一行的printf打印的是2147483647 而不是123456789999999999 溢出了吧
页:
[1]