Displaying items in a vector?

I have a Vector of an class called Zombie. im trying to read out the next instance of Zombie every time the function is called

1
2
3
4
  void DisplayZombie(vector<Zombie> &DZ) //how do i display a certain number in the vector??
{
  cout<<DZ[].GetZombie() <<endl;
}
I'm not sure I understood the question...
Do you want to access a particular member of the vector? If so, you can simply use the [] operator with the index you want. For example DZ[0], DZ[1], DZ[2], ..., DZ[DZ.size()-1]
Topic archived. No new replies allowed.