I\'ve a 2d array, say A[2][3]={{1,2,3},{4,5,6}}; and I want to push it into a 2D vector(vector of vectors). I know you can use two for loops to pus
A[2][3]={{1,2,3},{4,5,6}};
for loops
You can resize vectors and then use copy.
int A[2][3]={{1,2,3},{4,5,6}}; std::vector< std::vector > vec; vec.resize(2); for (int i=0; i<2; i++) { vec[i].resize(3); std::copy(A[i], A[i]+3, vec[i].begin()); }
Is it practical? Definetly not.