1将CString转成int类型
CString str(_T(“123”));
Int i = _ttoi(str);
2 int转成 CString
CString Str;
int a = 15;
Str.Format(_T("%d"),a);
3 char* 转成CString
(1)可以直接构造函数.如下:
char* p = "test";
CString str(p);
(2)可以用成员函数Format 如下:
char* p = "test;
CString str;
str.Format("%s", p);
4 CString转char*
char* ch = cstring.GetBuffer(cstring.GetLength());