Friday, July 2, 2010

How to Convert From CString into Int also Vice Versa in C++

From Int to CString

int intTemp = 1000;
CString strTemp;
strTemp.Format("%d", intTemp);
strTemp = _T("Retry after ") + strTemp + _T(" Miliseconds");

From Int to CString

CString strTemp = "1000";
int intTemp = atoi(strTemp);

No comments: