I need to have dynamically allocated space of structs and those structs have to contain another dynamically allocated. If I do it by manual allocation, that would laborious.
So I want to do it through vectors:
using namespace std;
struct lol{
int value;
vector<int> vekt;
};
vector<lol> vektt;
It is logically, that I am going to do it like the code above but I dont know how to do 2 things that I am going to need for my program:
1.iterate through both of them to get value
s
2.push something into vekt
( the vector of struct );
I tried something like this for pushing but doesnt work:
vektt[0] . vekt . push_back( 2 );
So I need to know how to iterate through both of these vectors and how to access members and methods of the vector vect
.