Is it possible to iterate through a struct?
For example
struct team{
int player1;
int player2;
int player3;
int player4;
...
int player
I would propose to use container instead of many variables, for example you could use std::array
or std::vector
. This way it will be trivial to iterate, much easier to make a copy. But also it's better from design point of view: in case you decide to change the number of players it will be much easier to change the container rather than add/remove many fields