Steve
2008-07-27 14:13:58 UTC
Hi all,
Having a few problems in BCB5 with the following. Any advice will be
greatly received.
I have a struct as so:
typedef struct
{
double min;
double qt1;
double med;
double qt3;
double max;
} sTestStats;
I then declare a vector of structs like:
vector<sTestStats> wfrStats;
I then try to fill it with:
tmpData.min = min(data);
tmpData.qt1 = percentile(data, 0.25);
tmpData.med = median(data);
tmpData.qt3 = percentile(data, 0.75);
tmpData.max = max(data);
wfrStats.push_back(tmpData);
where tmpData is a local variable of the above struct type.
However, when my program runs, the data doesn't appear to be going into
the vector. When I debug what's going on and try looking at wfrStats[0],
the debugger shows the message:
wfrStats[0]: E2094 'operator+' not implemented in type
'std::vector<sTestStats, std::allocator<sTestStats> >' for arguments of
type 'int'
What does this mean? What have I done wrong, or what have I not done?
Thanks for reading.
S
Having a few problems in BCB5 with the following. Any advice will be
greatly received.
I have a struct as so:
typedef struct
{
double min;
double qt1;
double med;
double qt3;
double max;
} sTestStats;
I then declare a vector of structs like:
vector<sTestStats> wfrStats;
I then try to fill it with:
tmpData.min = min(data);
tmpData.qt1 = percentile(data, 0.25);
tmpData.med = median(data);
tmpData.qt3 = percentile(data, 0.75);
tmpData.max = max(data);
wfrStats.push_back(tmpData);
where tmpData is a local variable of the above struct type.
However, when my program runs, the data doesn't appear to be going into
the vector. When I debug what's going on and try looking at wfrStats[0],
the debugger shows the message:
wfrStats[0]: E2094 'operator+' not implemented in type
'std::vector<sTestStats, std::allocator<sTestStats> >' for arguments of
type 'int'
What does this mean? What have I done wrong, or what have I not done?
Thanks for reading.
S