MFC中 CString与int的转化

int 转化为SCtring:

     int n = 123; 

     CString str;

     str.Format("%d",n); 

报错的话则改为:str.Format(_T("%d"),n); 或者 str.Format(TEXT("%d"),n); 即可

CString 转化为 int:

CString str("123");
int n= _ttoi(str);

原文地址:https://www.cnblogs.com/lxt287994374/p/3362507.html