you have to initialize the vector before you can store anything in it.
Type::Type() : name(4){}
will initialize the vector to a size of 4 without assigning any values.
Also you access the elements of a vector with name[0], name[1]...
not name.at(0)
Last edited on
your vector is implicitly of size 0
push_back() statement is one of the options for adding new values
1 2 3 4 5 6
|
Type::Type()
{
bla.push_back(nullptr);
bla.push_back(nullptr);
...
}
|
Last edited on
Thanks rich1 you fixed the problem. Thanks redwayne as well..