overload and overwrite in C++

1. overload :

don't using it in different scope. it will hidden the one in base or global scope.

2. overwrite:

using it in different scope. add virtual in base scope. and only be effective for point and reference. will not work for object.

base.f();

derive.f();

base * bs=new derive();

bs->f() //base one without virtual;

bs->f() //derive one with virtual;

上一篇:CDOJ 1962 天才钱vs学霸周2【最大流】


下一篇:selenium2 python自动化测试实战(回归测试)