为了使用cout:std :: cout << myObject,为什么我必须传递一个ostream对象?我认为这是一个隐含的参数.
ostream &operator<<(ostream &out, const myClass &o) { out << o.fname << " " << o.lname; return out; }
谢谢
c++ overloading ostream operator-keyword
c++ ×1
operator-keyword ×1
ostream ×1
overloading ×1