I am trying to initialize a pointer (*vectorName
) with a 2D vector 366 by 4.
Both
vector<int> *vectorName = new vector<int>(366, new vector<int>(4));
and
vector<int> *vectorName = new vector<int>(366, vector<int>(4));
do not work and give me the error
Error: no instance of constructor "std::vector, <_Ty, _Alloc>::vector [with_ty=int, _Alloc=std_allocator]" argument types are (const int, std::vector>*)
What can I do?
This is happening within the main function.
vector<int>
. That has one dimension. – juanchopanza