Assigning to a two dimensional vector in c++

Viewed 10987
#include<bits/stdc++.h>
using namespace std;
main()
{
    vector<vector<int> > v;
    for(int i = 0;i < 3;i++)
    {
        vector<int> temp;
        for(int j = 0;j < 3;j++)
        {
            temp.push_back(j);
        }
        //cout<<typeid(temp).name()<<endl;
        v[i].push_back(temp);
    }
 }

I am trying to assign to a two dimensional vector. I am getting the following error

No matching function for call to 
std ::vector<int>::push_back(std::vector<int> &)
7 Answers
Related