Good morning to all!
I'm a C++ new-newbie... and I have a problem :guru:
i' ve to manage an array of vector:
int NumCols=1;
vector<int> a[NumCols];
then i should initialize the first (and at all, only) element of the fisrt vector with 0 value.
and so i write:
a[0].push_back(0);
But this give me an error
Error: non class,struct,union object a[0] used with . or -> FILE:L.C LINE:165
Could you give me some hint?
After this i have to increment NumCols (in a cycle when some conditions are satisfied):
for (i=1; i<jet.size(); i++){
for (int cols=0; cols<NumCols; cols++){
CalculateDR(jet, jet[a[cols].front()]);
if (DR> DRref){
NumCols++;
a[NumCols].push_back(jet.Label);
break;
}
if (DR <= DRref){
a[cols].push_back(jet.Label);
break;
}
}
}
as i ve already wrote, i m a newbie and so i suppose that there are many errors.....
Thanks to all!
gio
I'm a C++ new-newbie... and I have a problem :guru:
i' ve to manage an array of vector:
int NumCols=1;
vector<int> a[NumCols];
then i should initialize the first (and at all, only) element of the fisrt vector with 0 value.
and so i write:
a[0].push_back(0);
But this give me an error
Error: non class,struct,union object a[0] used with . or -> FILE:L.C LINE:165
Could you give me some hint?
After this i have to increment NumCols (in a cycle when some conditions are satisfied):
for (i=1; i<jet.size(); i++){
for (int cols=0; cols<NumCols; cols++){
CalculateDR(jet, jet[a[cols].front()]);
if (DR> DRref){
NumCols++;
a[NumCols].push_back(jet.Label);
break;
}
if (DR <= DRref){
a[cols].push_back(jet.Label);
break;
}
}
}
as i ve already wrote, i m a newbie and so i suppose that there are many errors.....
Thanks to all!
gio