Help in filtering objects?

I have this code that prints out 5 weapons. How do I filter them? My professor used a for loop but I didn't understand why. Thanks :)

void main ()
{
string Weapons[5] = {"Sword", "Spear", "Arrow", "Dagger" , "Knife"};
int damage[5]= {25, 20, 15, 10, 5};


character first;
first.stat("Adriel", "50", "40");

obstacle fourth;
fourth.enemy("Rock", "50", "Log", "40\n");

cout << "Your weapon inventory consists of: \n";
cout << Weapons[0] << " : " << damage[0] << endl;
cout << Weapons[1] << " : " << damage[1] << endl;
cout << Weapons[2] << " : " << damage[2] << endl;
cout << Weapons[3] << ": " << damage[3] << endl;
cout << Weapons[4] << " : " << damage[4] << endl;
getch();
}
What do you mean by filter?
Topic archived. No new replies allowed.