在一个类的构造函数中,CString s = _T("啦啦啦");就会乱码

解决方案 »

  1.   

    CString::CStringCString( );
    CString( const CString& stringSrc );
      throw( CMemoryException );
    CString( TCHAR ch, int nRepeat = 1 );
      throw( CMemoryException );
    CString( LPCTSTR lpch, int nLength );
      throw( CMemoryException );
    CString( const unsigned char* psz );
      throw( CMemoryException );
    CString( LPCWSTR lpsz );
      throw( CMemoryException );
    CString( LPCSTR lpsz );
      throw( CMemoryException );参数: stringSrc 一个已经存在的CString对象,它要被拷贝到此CString对象中。  
    ch 要被重复nRepeat次的单个字符。  
    nRepeat 要对ch重复的次数。  
    lpch 一个指向字符数组的指针,该字符数组的长度是nLength,不包括结尾的空字符。  
    nLength pch中的字符的个数。  
    psz 一个要被拷贝到此CString对象中去的以空字符结尾的字符串。  
    lpsz 一个要被拷贝到此CString对象中去的以空字符结尾的字符串。  示例:下面的例子说明了如何使用String::CString。
    // CString::CString示例:
    CString s1; // 空字符串
    CString s2( "cat" ); // 从一个文字的C字符串
    CString s3 = s2; // 拷贝构造函数
    CString s4( s2 + " " + s3 ); // 从一个字符串表达式
    CString s5( 'x' ); // s5 = "x"
    CString s6( 'x', 6 ); // s6 = "xxxxxx"
    CString s7((LPCSTR)ID_FILE_NEW); // s7 = "Create a new document"
    CString city = "Philadelphia"; // 不是赋值操作符