int to string :

      int index=0;

     CString str;

     str.Format(_T("%d"),index);// str 为 0

     str.Format(_T("%02d"),index); // str 为 00

string to int :


   CString str = _T("00");
    int index;
    swscanf(str,_T("%d"),&index);