我是从C转VC的,不知道如何处理CString类的数值如果能把它按字符串处理就好,
兄弟们请帮忙[email protected]

解决方案 »

  1.   

    多查查MSDN,你的问题很好解决的!以下代码来自MSDN,仔细读一读吧
    :)
    // If the prototype of a function is known to the compiler,
    // the LPCTSTR cast operator may be invoked implicitlyCString strSports(_T("Hockey is Best!"));
    TCHAR sz[1024];lstrcpy(sz, strSports);// If the prototype isn't known, or is a va_arg prototype,
    // you must invoke the cast operator explicitly. For example,
    // the va_arg part of a call to sprintf() needs the cast:sprintf(sz, "I think that %s!\n", (LPCTSTR) strSports);// while the format parameter is known to be an LPCTSTR and
    // therefore doesn't need the cast:sprintf(sz, strSports);// Note that some situations are ambiguous. This line will
    // put the address of the strSports object to stdout:cout << strSports;// while this line will put the content of the string out:cout << (LPCTSTR) strSports;
      

  2.   

    对啊,遇到问题一定要仔细的看msdn那上面有答案的,如果没有是你没找到
      

  3.   

    msdn是好东西,很多网上的代码都是从msdn改编而来的