【发布时间】:2015-04-03 23:45:55
【问题描述】:
我需要一些帮助来将一系列值插入向量中。 例如,我的 .txt 文件看起来像这样;
0
0
35
0
2
0
35
0
0
0
2
0
etc.
我需要将这些值插入到二维向量中。 IE。如果表格是 10x5,它看起来像;
0 0 35 0 2
0 2 0 35 0
0 0 2 0 etc.
我想用这样的东西:
vector<vector<int>> Pix;
vector<int> tmp_col;
int i;
int j;
for (i=0; i<largeur; i++) {
for (j=0; j<hauteur; j++) {
}
}
但我不知道如何或是否使用 push.back 函数或 get.line(我对编程很陌生)
感谢您的帮助:)))
【问题讨论】:
标签: c++ multidimensional-array vector