Topic: Vector of Array Type : vector<double[3]> and vector::push_back()
Author: efausett@my-deja.com
Date: 1999/12/09 Raw View
Code looks like this:
void funct(double a[3]){
vector<double[3]> b;
b.push_back(a);
}
Getting the following error in VC++ 5.0:
error C2664: 'push_back' : cannot convert parameter 1 from 'double []'
to 'const
double (&)[3]'
Questions:
1)What is a 'const double (&)[3]'?
2)Is 'vector<double[3]> b;' legal?
3)I can always use a vector<vector <double> > and get the same type of
results,
but I think it will be slower, and reallocation for each internal vector
could
be expensive. How do I do this? I need a sizable array of a triplet of
double
values. [] access can be very nice.
4)I'm also working with quite a few multidimensional arrays. Any
repository of
info on the web about such structures using STL or not?
Email or Newsgroup answers would be greatly appreciated.
Thanks in advance,
--
E. Fausett
Student - Shape Modeling Lab
University of Aizu
Reply To:
EFausett@mail.com
Sent via Deja.com http://www.deja.com/
Before you buy.
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html ]