討論串[問題] 想請教一個C++考題
共 5 篇文章
首頁
上一頁
1
下一頁
尾頁

推噓3(3推 0噓 12→)留言15則,0人參與, 最新作者QQ29 (我愛阿蓉)時間15年前 (2010/06/08 20:23), 編輯資訊
0
0
2
內容預覽:
James大想問個問題. 之前知道constructor不該呼叫virtual但其實寫的時候根本沒留意過.... 現在想想. 假如我有個class A和class B:public A. 兩者都有個init() 各自有定義. 我猜我會這樣寫. A::A(). {. Init(). }. B::B()
(還有193個字)

推噓3(3推 0噓 3→)留言6則,0人參與, 最新作者loveflames (咕啾咕啾魔法陣)時間15年前 (2010/06/08 01:44), 編輯資訊
0
0
3
內容預覽:
剛剛查了一下規格書. 裡面有這段. Member functions, including virtual functions (10.3), can be called during. construction or destruction (12.6.2).When a virtual func
(還有1383個字)

推噓2(2推 0噓 2→)留言4則,0人參與, 最新作者james732 (好人超)時間15年前 (2010/06/08 01:25), 編輯資訊
0
0
2
內容預覽:
說到 constructor 不要呼叫 virtual function 的問題. 最近才遇到一個 Java 與 C++ 行為很不一樣的範例. (難怪 Effective C++ 的作者有特別提到與 Java 的差異...可惜剛看書時候還不懂). http://nopaste.csie.org/08
(還有386個字)

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者loveflames (咕啾咕啾魔法陣)時間15年前 (2010/06/08 00:56), 編輯資訊
0
0
1
內容預覽:
C++的規格書有段話這樣寫. the static type shall be a base class of the dynamic type of the object. to be deleted and the static type shall have a virtual destruc
(還有111個字)

推噓7(7推 0噓 15→)留言22則,0人參與, 最新作者NcuCsie (哇哩)時間15年前 (2010/06/07 23:13), 編輯資訊
0
0
0
內容預覽:
想請教各位版大...以下是一個C++面試題目,要考執行結果印出的是什麼. 程式碼如下:. #include <iostream>. #include <cstdio>. using namespace std;. class A. {. public:. A() { p(); }. ~A(){ p(
(還有283個字)
首頁
上一頁
1
下一頁
尾頁