标签: c++ abstract-class
这段代码出了什么问题?
class Base{ public: virtual void foo()=0; }; class Derived : public Base{}; auto main() -> int { Base *b = new Derived; }
答案 0 :(得分:4)
类Derived仍然是抽象的,因为纯虚函数Base::foo没有被覆盖。
Derived
Base::foo