Try to answer:
1. What are const int*, int const*, int * const
2. What is sizeof(A) for class A{}
3. What are some usage and pros and cons of virtual function
4. What is virtual base class
5. Give 3 different implementations of Fibonacci
何需太高清2021-03-18 10:17:39
HEHE魔王R水吹2021-03-18 10:28:28
1. 頭兩個係constant pointer,後面係constant value
2. empty class所以係1 byte?
3. pros 係佢可以令到interiance嗰陣做到dynamic binding
cons我諗唔到
4. virtual base class係整啲pure virtual function,幫一舊嘢abstraction,declare derived class一啲behavior,你唔可以整呢個class 嘅instance
5. Iteration, recursion, closed form solution
馬爾代夫的生活2021-03-18 10:28:30
手一黏便緊(UTC+92021-03-18 10:37:36
1. Please elaborate more eg tell me some scenario when there is compiler error
6. Do you have other strength eg nework?
HEHE魔王R水吹2021-03-18 10:50:54
int a = 10, b = 20;
const int *p1 = &a;
int const * p2 = &a;
int * const p3 = &a;
*p1 = b; // no problem
*p2 = b; // no problem
*p3 = b; // error
p1 = &b; // error
p2 = &b; // error
p3 = &b; // no problem
Networking唔識
叫做有用過下OpenMP同埋CUDA咁囉
提督の決断2021-03-18 10:54:41
高手
C++我乜都唔識
實驗羊2021-03-18 11:02:39
留夠等睇 FG 50K
手一黏便緊(UTC+92021-03-18 11:04:57
1. 你調轉左pointer to const 同const pointer
2. Ok la 要>0 具體implementation defined一般係四byte
3. 自己search下virtual function overhead
4. 你講既係abstract base class 唔係virtual base class 自己search下
5. Ok la also learn matrix method