将字符串转换为双精度
注:Unicode下可使用_wtof。不过最好使用_tstof,它实际上是宏,在不同的字符集下解释不同。这样两种字符集都可以编译通过。
CString str(_T("4.567"));
double Text = _tstof(str);
将字符串转换为 int 类型
CString str(_T("warning"));
int data = _wtoi(str);
将字符串转换为双精度
注:Unicode下可使用_wtof。不过最好使用_tstof,它实际上是宏,在不同的字符集下解释不同。这样两种字符集都可以编译通过。
CString str(_T("4.567"));
double Text = _tstof(str);
将字符串转换为 int 类型
CString str(_T("warning"));
int data = _wtoi(str);