STL vectors..

S

Sue

How can I dynamically allocate vectors of vectors?

I need

from
vector<class1> v1
vector<class1> v2
...
...

dynamic numbers of vectors of dynamic numbers of vectors..

How can I write this as a code?
 
R

roberts.noah

Sue said:
How can I dynamically allocate vectors of vectors?

I need

from
vector<class1> v1
vector<class1> v2
...
...

dynamic numbers of vectors of dynamic numbers of vectors..

How can I write this as a code?

vector< vector<class1> > class1mtx;
 
S

Stefan Okrongli

vector< vector<class1> > class1mtx;
VC6 bitches at that ... in that case, use:

typedef vector<class1> vec_class1;
vector<vec_class1> v;

Stefan
 
L

Luke Meyers

Stefan said:
VC6 bitches at that ...

VC6 is well-known for its dismal template "support." It's not a good
arbiter.
in that case, use:
typedef vector<class1> vec_class1;
vector<vec_class1> v;

Hopefully, the OP is not afflicted by the same unfortunate compiler
handicap, and can just use the original code.

Luke
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top