标签:http ase int prime eid void space stream out
测试代码:
1 #include <iostream> 2 #include <typeinfo.h> 3 4 class Base { 5 public: 6 virtual void vvfunc() {} 7 }; 8 9 class Derived : public Base {}; 10 11 using namespace std; 12 int main() { 13 Derived* pd = new Derived; 14 Base* pb = pd; 15 cout << typeid(pb).name() << endl; //prints "class Base *" 16 cout << typeid(*pb).name() << endl; //prints "class Derived" 17 cout << typeid(pd).name() << endl; //prints "class Derived *" 18 cout << typeid(*pd).name() << endl; //prints "class Derived" 19 delete pd; 20 }
输出结果:
标签:http ase int prime eid void space stream out
原文地址:https://www.cnblogs.com/sunbines/p/9535448.html