I have this data structure Seq which inherits the class vector but has some extra functionalities. Using this data structure Seq I have this predefined data structure:
typedef Seq< vector<int> > MxInt2d;
I want now to have a vector of several components of type MxInt2d; I was thinking about something like:
MxInt2d* loops;
it is just that I think I have to initialize this vector and I do not have a constructor for it. should I write a constructor in order to initialize it ?
So if on one hand I would have the declaration of the following data structure:
MxInt2d myEdges_;
which is then initialized. And on the other hand the declaration of my variable loops:
vector<MxInt2d> loops;
If I want to copy in loops[0] the first 5 elements of myEdges_, I would use the syntax:
for (int i=0;i<5;i++)
loops[0].push_back(myEdges_[i]);
The program gets compiled but when I run it I obtain a bus error message.. The same stuff happens if I use the initialization for a second loop:
for (int i=0;i<5;i++){
loops[1].push_back(myEdges_[i]);
}
(sorry for my bad judgement, I am really new with vector) madalina