CString tr1;
int y;
str1 = "123";
USES_CONVERSION;
char *ch = T2A(str1);
y=atoi(ch);
VS2005下CString 转 float
CString str(TEXT("12.3"));
float a=(float)wcstod(str,NULL);//wcstod这个函数是把CString转成double的,再把double强转成float就行了
CString tr1;
int y;
str1 = "123";
USES_CONVERSION;
char *ch = T2A(str1);
y=atoi(ch);
CString str(TEXT("12.3"));
float a=(float)wcstod(str,NULL);//wcstod这个函数是把CString转成double的,再把double强转成float就行了