我是第一次在STL库中使用vector类.我应该如何添加到矢量数组的特定行?
struct x{
vector <vector <int> > v;
int row;
};
vector< int* > my ints;
int add;
Run Code Online (Sandbox Code Playgroud)
如果我想用第一个整数指针添加到第一行v,我能做到吗?
myints[0]->v[myints[0]->row].push_back(add);
Run Code Online (Sandbox Code Playgroud)
这种方法是否可以创建向量ints的二维向量,其中每一行可能具有不同的长度(即具有不同的列数)?