一、int 转换为 CString
int num = 100;
strNum.format("%d",num);
二、CString 转换为 int
CString strNum = "123";
int num = atoi(strNum.GetBuffer());
strNum.ReleaseBuffer(); //GetBuffer()后一定要用ReleaseBuffer(),要不然对strNum的操作会无效
一、int 转换为 CString
int num = 100;
strNum.format("%d",num);
二、CString 转换为 int
CString strNum = "123";
int num = atoi(strNum.GetBuffer());
strNum.ReleaseBuffer(); //GetBuffer()后一定要用ReleaseBuffer(),要不然对strNum的操作会无效