CString和char转换
1.char* 转为CString
char* p = "abcd";
CString str = CString(p);
2.CString转换为char*
CStringA temp;
temp = str;
char* p = str.GetBuffer()
CString和int转换
1.CString ->int
int num;
CString str;
str.Format(TEXT("123");
num = _ttoi(str);
2.int转换为CString
int num = 123;
CString str;
str.Format(TEXT("%d",num));
CString转化为double
1.CString转换为double
double num;
CString str;
str.Format(TEXT"123.4");
num = _ttof(str);
2.double转换为CString
double num = 123.4;
CString str;
str.Format(TEXT("%lf"),num);