CString cstr = "1234";
string str = “5555”;
char *pCh = new char[50];
strcpy(pCh,”world!”);
1、CString→ char*
USES_CONVERSION;
pCh = T2A(cstr.GetBuffer());
cstr.ReleaseBuffer();
2、char*→ CString
USES_CONVERSION;
cstr = A2T(pCh);
3、string→ char*
strcpy(pCh,str.c_str());
4、char*→ string
s.assign(ch);
5、string→ CString
USES_CONVERSION;
cstr = A2T(const_cast<char*>(str.c_str()));
6、CString→ string
USES_CONVERSION;
str.assign(T2A(cstr.GetBuffer()));
cstr.ReleaseBuffer();
7、CString → int
num = _ttoi(str);
8、string → int
num = atoi(str.c_str());