friend istream &operator>>(istream &stream, product &p)
{
cout << "Number of " << p.name << ": " << p.number << endl;
return stream;
}
這樣重載運算子有錯嗎??因為我在main裡打cout << product;
的時候都會出現error C2593: 'operator >>' is ambiguous
可是我是直接把課本的範例貼上去,應該是不會錯的才對@@
麻煩大家幫我解惑一下,謝謝
--
* Origin: ★ 交通大學資訊科學系 BBS ★ <bbs.cis.nctu.edu.tw: 140.113.23.3>