I create a nested vector: vector<vector>test, and i want to add 2 elements to each inside vector. The above is my target, so I try two method
vector<vector<int>> test;
1: test.push_back({1,2});
2: test.emplce_back({1,2});
And I found the second method is wrong, Why?
Aucun commentaire:
Enregistrer un commentaire