討論串[問題] 兩題C++面試題的詢問
共 4 篇文章
首頁
上一頁
1
下一頁
尾頁

推噓1(1推 0噓 1→)留言2則,0人參與, 8年前最新作者wawi2 (@@)時間8年前 (2018/04/06 02:47), 8年前編輯資訊
0
0
1
內容預覽:
Regarding the first question, the answer shall be B0.. The virtual keyword suggests the function binding occur in run-time.. However the default param
(還有338個字)

推噓2(2推 0噓 0→)留言2則,0人參與, 8年前最新作者plsmaop (plsmaop)時間8年前 (2018/04/04 10:42), 8年前編輯資訊
0
0
1
內容預覽:
https://en.m.wikipedia.org/wiki/Data_structure_alignment. 在Typical alignment of C structs on x86這個條目下有說,會把整個struct湊成其中最大的type的大小的倍數. 如果我沒有理解錯的話,整個stru
(還有132個字)

推噓3(3推 0噓 0→)留言3則,0人參與, 8年前最新作者descent (「雄辯是銀,沉默是金」)時間8年前 (2018/04/03 19:05), 8年前編輯資訊
0
0
1
內容預覽:
具體的規則我不了解, 不過用 cfront 轉出來的結果如下:. ((*(((void (*)(struct A *__0this , int __2a ))(__1p -> __vptr__1A [1]).f))))(((struct A *)((((char *)__1p ))+ (__1p -
(還有240個字)

推噓10(10推 0噓 14→)留言24則,0人參與, 6年前最新作者Cosmology (宇宙學型男)時間8年前 (2018/04/03 11:52), 編輯資訊
0
0
0
內容預覽:
先說是面試題 所以會有一些奇怪的寫法. 晚輩還是剛入行的新人 若有冒犯 請見諒. 1.. class A. {. public:. virtual void foo(int a = 0). {. printf("A %d\n", a);. }. };. class B : public A. {.
(還有638個字)
首頁
上一頁
1
下一頁
尾頁