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;
}
該程序編譯成功,但不打印任何東西。可能是什麼問題呢?我的重載運算符<<函數有什麼問題?