RT

解决方案 »

  1.   

    int x = 1001;
    CString strInt;
    strInt.Format(_T("%d"),x);
      

  2.   

    int x=1002;
    TCHAR buf[10];
    _stprintf(buf,"%d",x);
      

  3.   

    #include<>int x = 1003;
    char buffer[20];
    _itoa( i, buffer, 10)
      

  4.   

    //------------------------------------------------------
    //Convert int to CString
    //------------------------------------------------------
    CString CNtnmrVcGUIDlg::IntToStr(int iVar)
    {
    char cTemp[256];
    itoa(iVar,cTemp,10);
    return (CString)cTemp;
    }
      

  5.   

    CString str;
    int ll = 100;
    sprintf((LPSTR)(LPCTSTR)str, "%d", ll);
      

  6.   

    最简单的:CString str;int a=...;
             str.Format("%d",a);
             cout<<str;
    str便为a的CString型