討論串[問題] virtual function的問題
共 2 篇文章
首頁
上一頁
1
下一頁
尾頁

推噓1(1推 0噓 0→)留言1則,0人參與, 最新作者dendrobium (石斛蘭)時間16年前 (2009/09/27 16:32), 編輯資訊
0
0
0
內容預覽:
這當然是必經之路 試想如果沒有實體產生. 那member function中的this要指向何方?. 這種寫法會產生很多沒用到的 B 和 C object你有更好的選擇. 就是. A *a[10];. int i=0;. while ( cin >> input ). {. if ( input )
(還有15個字)

推噓3(3推 0噓 3→)留言6則,0人參與, 最新作者ckaha (★閃亮數學推理★)時間16年前 (2009/09/27 15:55), 編輯資訊
0
0
0
內容預覽:
假設. class A{. public:. virtual bool test() =0;. };. class B:public A{. xxxxx;. public:. bool test(){...};. };. class C:public A{. xxxx;. public:. bool
(還有848個字)
首頁
上一頁
1
下一頁
尾頁