【重载】【重写】【重定义】的区别和联系
测试重写/重载/重定义
class Base
{
public :
void TestOver ()
{
cout<<"Base::TestOver" <<endl;
}
};
class Derive : public Base
{
public :
void TestOver ()
{
cout<<"Derive::TestOver" <<endl;
}
};
void TestOver ()
{
Derive d1 ;
d1.TestOver ();
d1.Base ::TestOver();
}
原文地址:http://10622551.blog.51cto.com/10612551/1696427