C++ 类型判断 typeid class A{ virtual void f(){};};class B: public A{}; 在main方法中验证 Person* p = new son(); if (typeid(*p) == typeid(son)) { std::cout << "equal" << std::endl; } else... c/c++ 2023-11-02 38 点赞 0 评论 57 浏览