how to create a vector of int 2D array in c++

This question already has an answer here:

  • std::vector of an array 3 answers

  • Native arrays are not copyable, moveable or assignable, so they cannot be stored in a standard container.

    However, the wrapper std::array<T,N> is, so std::vector<std::array<std::array<int, 2>, 2> > is one way to do what you want.


    You can create a 2D vector in this way: std::vector <std::vector <data_type> > vector_name

    Note: In C++03, there must be a white space between > and > .

    链接地址: http://www.djcxy.com/p/85940.html

    上一篇: 在C中查找递增顺序的最大子数组元素的总和?

    下一篇: 如何在c ++中创建int 2D数组的向量