Vector of struct

Hello everyone,
I have a struct that is a vector of struct,defined as:
1
2
3
4
5
6
7
8
9
struct a{
  int b;
  int c;
};

struct d{
  vector<a> e;
  vector<a> f;
};


now i want to assign values to vectors,like for example
1
2
d example;
example.e[0].b=10;

how can I do this?
thanks for helping
1
2
3
example.e.push_back( a() );

example.e[0].b = 10;
ok!!thank you very much vlad!
Topic archived. No new replies allowed.