#include
using namespace std;
int main()
{
char str[10]="12325";
cout<<atoi(str)*10<char ch[10]="123f25";
cout<<atoi(ch)<return 0;
}
atoi就是将字符串转换为整数,atoi(str)就是将字符串“12345”转换成了int类型的数字12325,再*10就是乘以10,所以atoi(str)*10输出是123250
而ch字符串中包含字母“f", atoi函数在识别的时候先识别出了123,遇到f他发现不是数字就停止识别了,所以atoi(ch)输出的是123