ostream & operator<<(ostream &out, const IntList &rhs)
{
IntNode *i = rhs.head;
out << rhs.head;
while (rhs.head != 0)
{
out << " " << i;
i = rhs.head->next;
}
return out;
}
该程序编译成功,但不打印任何东西。可能是什么问题呢?我的重载运算符<<函数有什么问题?