大家好,我是一个新手,我想问VC里有没有什么函数可以将int转换成CString的?反过来呢?

解决方案 »

  1.   

    CString m_Info;
    m_Info.Format("%d",iResult);
      

  2.   

    int it=200;
    CString str;str.Format( "%d", it );   //str = "200"
    int is=atoi(str);         //is = 200
      

  3.   

    int it=200;
    CString str;str.Format( "%d", it );   //str = "200"
    int is=atoi((LPCTSTR)str);         //is = 200
      

  4.   

    CString dd;
    int in_dd=atoi(dd.GetbufferLenght(dd.GetLenght()));
      

  5.   

    itoa()//int转换为char类型,再强制类型转换为CString
    atoi()//CString、char转换为int;