C++ 中const修饰虚函数实例详解
【1】程序1
#include
using namespace std;
class Base
{
public:
virtual void print() const = 0;
};
class Test : public Base
{
public:
void print();
};
void Test::print()
{
cout << Test::print() << endl;
}
void main()
{
C++ 中const修饰虚函数实例详解
【1】程序1
#include
using namespace std;
class Base
{
public:
virtual void print() const = 0;
};
class Test : public Base
{
public:
void print();
};
void Test::print()
{
cout << Test::print() << endl;
}
void main()
{