Asymmetric data structure

Hi,

I am trying to create an structure of data with following elements:
1
2
3
4
5
6
7
8
9
struct stest {
std::vector<int> na;
std::vector<double> nb;

std::vector<double> va;
std::vector<double> vb;
std::vector<double> vc;
std::vector<double> vd;
}

I would like to modify the composition of this struct, so that I can create a special data structure by
1
2
3
vector<stest*> data_test;
for(int i = 0; i < 10; i++)
   data_test.push_Back(new stest);

within this structure, I have: only one na and one nb, but ten groups of combination of va, vb, vc, vd that I can access by pointer, which means na, nb are independent but still inside of the structure.

Could anyone please help me? Thanks!
I'm not sure what you mean by:

ten groups of combination of va, vb, vc, vd that I can access by pointer, which means na, nb are independent but still inside of the structure.
I meant when I push_back data_test, only va, vb, vc, vd will be implemented. So I can have data_test.na, data_test.nb, but data_test[0].va, data_test[1].va, ... , data_test[0].vb, data_test[1].vb, ... , data_test[0].vc, data_test[1], ......
Topic archived. No new replies allowed.