JSRUN 用代码说话
精选cpp
全部cpp
移动语意、移动构造、移动赋值示例


#include<iostream> using namespace std; class Base { public: virtual void fn() { cout <<"In Base Class\n";} }; class SubClass : public Base { public: virtual void fn(){ cout <<"In Sub Class\n"; } }; int main() { Base bc; Base *p; SubClass sc; p=&bc; p->fn(); p=&sc; p->fn(); }


没有了
1/2323 下一页