V

Hi how are you doing
Last edited on
What array?
Instead of using the variable numItems to keep track of the size you can use use the size() member function.

 
inventory.size()

http://www.cplusplus.com/reference/vector/vector/size/
Last edited on
So just like this?
int reset =1;
do {

cin.ignore();
cout << " Your weapons are: \n";

for (int i = 0; i < inventory.size(); ++i)
{
cout << "\t" << inventory[i] << endl;
}
Yes, that looks like it should work.
Topic archived. No new replies allowed.