Hi,

It may be a simple question. But, how can i fill a vector of vector in a loop? Below is what I have tried:

std::vector< std::vector<float> > vec;

for (int i=0; i<n++; i++){

for (int j=0; j<m; j++){

//I tried the below ones. But none works.

vec[i][j]=i*j;

vec.push_back(i*j);

vec[i].push_back(i*j);

vec[i][j].push_back(i*j);

}

Thanks.