这TCHAR 到底要怎么转成 int呢??
定义了:TCHAR sim[120] ;TCHAR sag[120]
调用函数 Getinfo( sim,sag)
结果放在sim,sag 里,我用MessageBox可以显出来,
sim=60 ,sag=70
我想把sim,sag转成 int 或 long (因为要做一些数字大小的比较)
但用了几种方法都不行,如:
int n = _ttoi(sim); // n的结果是0
int n = _wtoi(sim); // n的结果还是0
int n= atoi(sim); // 也不行,atoi用在char 不能用在Tchar
这TCHAR 到底要怎么转成 int呢??
TCHAR sim[120] = "123456";
CString str;
str = sim;
int n;
n = atof(str);
这样不知道合不合你要求 执行 n = atof(str); 后 错误
提示: error C2664: 'atof' : cannot convert parameter 1 from 'CString' to 'const char *' 把atof换成_ttoi试试
页:
[1]
