Vector declaration “expected parameter declarator”

You have to initialize the variable in the constructor’s initializer list:

class X 
{
    private:
     vector<double> dQdt;
    public:
     X() : dQdt(3) {}
};

Leave a Comment