L
lou zion
hi all,
i want to create a vector where each element is an array of 40 doubles. is
this valid? something like:
void abc( std::vector<double> InVals)
{
typedef double DataSeriesType[40];
std::vector<DataSeriesType> DataSeriesX;
DataSeriesType NewData;
DataSeriesX.push_back(NewData);
for (int i=0; i<(int)InVals.size(); i++) {
DataSeriesX[0]=InVals;
}
}
the above is not good code, i know, i'm just using it as an example of
syntax, not style.
essentially i want to store an array (or possibly a vector) in a vector. if
i just store a pointer to an array in a vector, what happens if i delete
that element? do i need to deallocate storage somehow? i'd prefer an array,
but if there's a better way to do this, please enlighten.
thnx
lou
i want to create a vector where each element is an array of 40 doubles. is
this valid? something like:
void abc( std::vector<double> InVals)
{
typedef double DataSeriesType[40];
std::vector<DataSeriesType> DataSeriesX;
DataSeriesType NewData;
DataSeriesX.push_back(NewData);
for (int i=0; i<(int)InVals.size(); i++) {
DataSeriesX[0]=InVals;
}
}
the above is not good code, i know, i'm just using it as an example of
syntax, not style.
essentially i want to store an array (or possibly a vector) in a vector. if
i just store a pointer to an array in a vector, what happens if i delete
that element? do i need to deallocate storage somehow? i'd prefer an array,
but if there's a better way to do this, please enlighten.
thnx
lou