class player
{
public:
shortint health = 5;
shortint damage = 5;
string name;
};
int main()
{
player one;
one.health = 3;
player two;
player three;
three.health = 2;
three.damage = 2;
etc...
My code actually has 60 instances of the class, most of them deviating slightly from the default variables. How can I search for class members that have certain variables? For example, how to find all players with 5 health, or all players with the same name?
Would it also be good practice to use a header file to define all these things?