Link to home
Start Free TrialLog in
Avatar of meow00
meow00

asked on

How do I declare a vector of vector<Animal> ?

Hi experts,

   I have a struct

typedef struct{
  // blah
}Animal ;

and I need several different Animal vectors ...
i.e.  vector<Animal> Dog, Cat, Pig ;

but I want Dog, Cat, Pig to be stored as element of a new vector ?

How do I declare and use such a vector ???

 many thanks !
SOLUTION
Avatar of andrewjb
andrewjb
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of jkr
jkr
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Darrylsh
Darrylsh

vector<vector<Animal> >

note there MUST be a space between the last two "> >" or the compiler will interpret it as the shift operator >>
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial