#include "stdafx.h" #include
Class base {public: Virtual void f (int); Virtual Void F (Double); Virtual Void G (INT i = 10);
Void Base :: f (int) {cout << "Base :: f (int) << endl;}
Void Base :: F (Double) {cout << "Base :: f (double) << endl;}
Void Base :: G (INT I) {cout << I << endl;
Class Derived: Public Base {public: Void F (Complex
Void Derived :: F (Complex
Void derived :: g (int i) {cout << "Derived :: g (int i)" << i << endl;}
INT _TMAIN (int Argc, _tchar * argv []) {base * pb = new derived; pb-> g (); delete pb; return 0;}
What will it be output?
-----------------------------------------------
Haha - | Derived :: G (INT I) 10 (Not 20 !!)
Because the preset parameters are static types to be set, the modified function type is dynamic.