我想問在C++中, 如何將數組插入到2個dim數組的末尾?
我的代碼,它仍然會從編譯器出現錯誤,是這樣在C++中插入數組指針到2維向量
int *A;
A = new int[10];
vector<vector<int>> myarray;
for (int j = 0; j < 5; j++)
{
for (int i = 0; i < 10; i++)
{
A[i] = i + j;
}
myarray.push_back(vector<int>{10});
copy(A, A + 10, myarray.back());
}
誤差
C2794:「的iterator_category」:沒有任何直接或間接的基類中的一員'的std :: iterator_traits < _OutIt>'
而錯誤是? –