📜  调整二维向量的大小 c++ 代码示例

📅  最后修改于: 2022-03-11 14:44:55.674000             🧑  作者: Mango

代码示例2
myVector.resize(row_count, vector(column_count, initialization_value));
//Example1: create a 2D integer vector with 5 rows and 5 columns having "1"
 myVector.resize(5, vector(5, 1));
//Ex2
 myVector.resize(n);
 for (int i = 0; i < n; ++i)
     myVector[i].resize(m);