C++的虚函数与抽象类
2017-02-06
22
C++的虚函数与抽象类2011-04-281.虚函数1.1虚函数的作用虚函数的作用是允许在派生类中重新定义与基 类同名的函数,并且可以通过基类指针或引用来访问基类和派生类中的同名函数。class Time{ public: Time(int=0,int=0,int=0); void show(); protected: int hour; int min; int sec;};class LocalTime:public Time{ publ...