摘要:
when declare a reference , you must initialize it. and you can never change the reference variable to refer the other variable. the reference variable... 阅读全文
摘要:
when passing a pointer to a function, the pointer must have been initialized!!!code illustrationvoid func(int * p){ p = (int *)calloc(1, sizeof(int));}int main(){ int * a ; func(a); return 0;}when passing the pointer 'a', the error is occurred, even then the function seems like to initia... 阅读全文
摘要:
Function pointers are somewhat different than all other types because the syntax does not follow the pattern typedef ;. Instead, the new alias for the type appears in the middle between the return type (on the left) and the argument types (on the right). Consider the following code, which does not . 阅读全文
摘要:
the key point of the Virtual Function is the Runtime Polymorphismcode illustration #include class animal{public: virtual void getspecies(void);private: int a;};class horse:public animal{public: virtual void getspecies(void);};class lion:public animal{public: virtual void getspecies(void)... 阅读全文