基类与派生类同名同类型的函数重载的问题请教?
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <conio.h>
#include <iostream.h>
class holder
{
public:
virtual void re();
};
void holder::re()
{
cout<<"基类"<<endl;
}
class hold1:public holder
{
public:
void re();
};
void hold1::re()
{
cout<<"派生类"<<endl;
}
main()
{
hold1 hold;
hold.re();
}
[此贴子已经被作者于2005-11-13 15:14:48编辑过]