我熟悉STL向量。不过,我想知道哪些调用构造函数和它做什么,当我最初的向量类似如下:std :: vector <int> vec [nx] [ny];
int nx=5; int ny=7; std::vector<int> myvec[nx][ny];
更新: 我编译的代码与TDM-GCC 4.9.2,但显然它需要用“const int”对其他编译器进行初始化,所以我在这里重写它:
#include <iostream>
#include <vector>
using namespace std;
int main(){
std::vector<int> myvec[7][9];
return 0;
};
谢谢。
希望你知道你正在创建矢量的2D阵列(7×9),而不是一个二维向量。 – rustyx