我在我的頭文件中有這樣的代碼,並且我在ostream和istream行上有大量錯誤。一個錯誤 「失蹤 」; &「 前」 「」 和IM confuzzled,提前即時通訊新本對不起C++運算符<< and >>在頭文件中的方法,做得很錯
#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);
感謝
或'#包括' –
2011-04-19 15:40:10
什麼是'iosfwd'嗎?從來沒有聽說過它...... – 2011-04-19 19:29:00
@Giovanni'ios' = iostreams'fwd' = forward,換句話說:標準iostreams的前向聲明(不是完整的定義) – Jesper 2011-04-19 21:10:32