本文来自E+E技术论坛
CString _temp = "100";
int _int;
_int = atoi(_temp);
===================================
CString str;
int i = 2334;
str.Format("%d",i);
类似还有:
1、str.GetBuffer(0);//取得CString的char*
2、int intv=atoi(str.GetBuffer(0));//CString to Int
3、float floatv=(float)atof(str.GetBuffer(0));//CString to float
4、long longvv=atol(str.GetBuffer(0));//CString to Long
5、double doublev=atof(str.GetBuffer(0));//CString to Double
6、str.Format("%d,%f,%ld,%lf,%c,%s",int,float,long,double,char,char*)//各类型到CString,int等只表示此类型的变量