是否为String(const char *)构造了一个临时对象,然后进行了operator=()操作。
我猜的。

解决方案 »

  1.   

    在operator=()调用之前,构造了这个临时变量并作为参数压栈
      

  2.   

    这是自动类型转化,就象
    int a;
    char c = 'c';a = c;呵呵。
      

  3.   

    有了这个函数,String::String(const char *s)才能这样用,你可以把它注释掉试试。
      

  4.   

    加上
    #ifdef _UNICODE
    const String& CString::operator=(LPCSTR lpsz)
    {......................................
    return *this;
    }
    #else //!_UNICODE
    const String& String::operator=(LPCWSTR lpsz)
    {
    ....................................
    return *this;
    }
    #endif  //!_UNICODE
    再实现这些