【发布时间】:2018-11-09 19:16:51
【问题描述】:
这是我的代码(我只写精华),我明白了:
错误:'operator
class Mobil {
public:
void print() const;
int getNumber() const;
double getData() const;
friend ostream& operator <<(ostream&, const Mobil&);
};
ostream& operator<<(ostream& out, const Mobil& mobil) {
out << mobil.print() << endl;
return out;
}
有什么问题?
【问题讨论】:
-
@Rhathin 这对我来说是个完美的答案。
-
@Rhathin 不要在 cmets 部分回答,谢谢。