如题!

解决方案 »

  1.   

    CString s( "abcd" );
    char * p = s.GetBuffer( 10 );
    strcpy( p, "Hello" );   // directly access CString buffer
    s.ReleaseBuffer( );
      

  2.   

    CString strBuf("aaaaa");
    char *p;
    p= new char[strBuf.Getlength()+1);
    strcpy(p,strBuf);
      

  3.   

    强转即可:
    CString s( "abcd" );
    char *p = (char *)(const char *)s;
      

  4.   

    CString str( "abcd" );
    char * p = str.GetBuffer( 10 );
    str.ReleaseBuffer( );
      

  5.   

    CString strBuf("aaaaa");
    char *p;
    p= new char[strBuf.Getlength()+1);
    strcpy(p,strBuf);delete[] p;