is this typedef valid?
From: lou zion (illuzioner_at_adelphia.net)
Date: 02/17/05
- Next message: Ioannis Vranos: "Re: is this typedef valid?"
- Previous message: Kevin Fisher: "Compiling libwww.a from source"
- Next in thread: Ioannis Vranos: "Re: is this typedef valid?"
- Reply: Ioannis Vranos: "Re: is this typedef valid?"
- Reply: Victor Bazarov: "Re: is this typedef valid?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 16 Feb 2005 18:33:14 -0800
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][i]=InVals[i];
}
}
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
- Next message: Ioannis Vranos: "Re: is this typedef valid?"
- Previous message: Kevin Fisher: "Compiling libwww.a from source"
- Next in thread: Ioannis Vranos: "Re: is this typedef valid?"
- Reply: Ioannis Vranos: "Re: is this typedef valid?"
- Reply: Victor Bazarov: "Re: is this typedef valid?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|