jeudi 26 février 2015

Why this code in C++ doesn't work?



vector<vector<int> > v(4);

vector<int> k(4,0);

for (int i=0; i<v.size(); i++)
v.push_back(k);

for (int i=0; i<v.size(); i++) {
for (int j=0; j<k.size(); j++)
cout << v[i][j];
cout << endl;


I think it should work but the program doesn't execute anything. Where am I wrong?




Aucun commentaire:

Enregistrer un commentaire