C++运算符<<和>>头文件中的方法,做得非常错误
我的头文件中有这段代码,并且 ostream 和 istream 行上有很多错误。一个错误是“&”之前“缺少”;”,我很困惑,我对此很陌生,抱歉
#pragma once
class ArrayIntStorage
{
public:
void readFromFile();
bool setReadSort(bool);
void sortStd();
void sortOwn();
ArrayIntStorage(void);
~ArrayIntStorage(void);
};
ostream& operator<< (ostream &out, const ArrayIntStorage &a);
istream& operator>> (istream &in, ArrayIntStorage &b);
提前致谢
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

发布评论
评论(4)
~没有更多了~
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
看起来您只需要
在这些行的前面放置一个 std 命名空间限定符,即:
Looks like you just need to do
then place a std namespace qualifier in front of them on those lines, ie: