C++类成员空间分配和虚函数表 Posted on 2017-08-03 | In C++ 最近在自学python,看到继承和类,就顺便复习了C++的类和继承等方面的知识。先看Base基类 123456789101112131415161718class Base {private: virtual void display() { cout<<"Base display()"<<endl; } void say(){ cout<<"Base say()"<<endl; }public: virtual void func(){cout << "Base func()" << endl; } void exec(){ display(); say(); } void f1(string a) { cout<<"Base f1(string)"<<endl; } void f1(int a) { cout<<"Base f1(int)"<<endl; } //overload}; Read more »