0
How do I use the function push_back
in a structure?
I have the arch structure:
struct Arco {
int i, j;
Arco () {};
Arco (const Arco& obj): i(obj.i), j(obj.j) {};
Arco(int _i, int _j) : i(_i), j(_j) {}
};
And then, I have a vector of arcing vectors:
vector < vector < Arco > > Df;
Df = vector < vector < Arco > >(nn, vector < Arco > ( ) );
I wish I could fill in the Df as follows:
Df[i][j].push_back(Arco(u,v));
How must I allow this command?