In C++, why is `new` needed to dynamically create an object rather just allocation?

前端 未结 5 821
猫巷女王i
猫巷女王i 2021-01-18 08:30

I\'ve got this trivial class hierarchy:

class Base {
public:
    virtual int x( ) const = 0;
};

class Derived : public Base {
    int _x;
public:
    Derive         


        
5条回答
提交回复
热议问题