friend ostream &operator<<(ostream &output, const Douary &d);
加上const
一般引用无法绑定到右值。
Douary & Douary::operator=(const Douary &d)
{
len=d.len;
if(len==d.len)
{
for(int i=0;i
Array[i]=d.Array[i];
}
}
else
{
cout<<"operator = error!"<
}
return *this;
}
你这个函数有问题 你的判断不是白做了吗?
len=d.len;
if(len==d.len)