[問題] C++編譯出現錯誤訊息
※ [本文轉錄自 C_and_CPP 看板]
作者: typecommand (:)) 看板: C_and_CPP
標題: [問題] C++編譯出現錯誤訊息
時間: Fri Apr 18 19:48:47 2008
已自行上google找答案,有找到可能的解答,但還是看不懂,
所以只好上來請教高手
http://www.cs.ucla.edu/~shinnerl/cs31/x/simpleIO/noStreamCopy.cpp
這是我的部份程式碼
(simstream.h)
class SimS {
public:
SimS (ostream &s);
~SimS (void);
private:
ofstream fp;
ostream stream;
friend class SimStream;
};
(simstream.cpp)
SimS::SimS (ostream &s) {
rc = 1;
stream = s; <------這行會出錯,錯誤訊息如下
is_opened = 0;
}
simstream.cpp: In method `ostream &ostream::operator= (ostream &)':
/usr/include/g++-3/streambuf.h:127: `ios &ios::operator= (ios &)' is private
simstream.cpp:19: within this context
懇請高手能給我一點方向,因為我這問題卡很久了,先謝謝了。
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.136.149.183
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.136.149.183
推
04/18 20:08, , 1F
04/18 20:08, 1F
→
04/18 20:08, , 2F
04/18 20:08, 2F
→
04/18 20:10, , 3F
04/18 20:10, 3F
※ 編輯: typecommand 來自: 140.136.149.183 (04/18 20:22)
※ 編輯: typecommand 來自: 140.136.149.183 (04/18 20:23)
→
04/18 20:23, , 4F
04/18 20:23, 4F
推
04/18 20:25, , 5F
04/18 20:25, 5F
→
04/18 20:26, , 6F
04/18 20:26, 6F
→
04/18 20:26, , 7F
04/18 20:26, 7F
→
04/18 21:30, , 8F
04/18 21:30, 8F
→
04/18 21:53, , 9F
04/18 21:53, 9F