You need to initialize the vector in A
‘s constructor:
#include <vector>
class A
{
std::vector<double> a;
public:
A() : a(20) {}
};
solved Why i cannot make vector in c++ class [duplicate]
You need to initialize the vector in A
‘s constructor:
#include <vector>
class A
{
std::vector<double> a;
public:
A() : a(20) {}
};
solved Why i cannot make vector in c++ class [duplicate]