string转换为其它数据类型 atoi _atoi_l, _wtoi, _wtoi_l

字符串string转换为其它数据类型

int atoi(const char *nptr);

string str="123456";

temp=str.c_str();

1)短整型(int)
i =  atoi(temp);
2)长整型(long)
l =  atol(temp);
3)浮点(double)
d= atof(s.c_str());

https://blog.csdn.net/ktpd_pro/article/details/62884025

u_short =_wtoi(CString);

原文地址:https://www.cnblogs.com/wllwqdeai/p/10003387.html