Best way to iterate through struct members of the same type?

May 1, 2015 at 5:12am
1
2
3
4
5
6
7
8
9
struct Times
{
int inputTime;
int updateTime;
int drawTime;
};

//iterate through each one, checking whatever needs to be check, etc


not the exact example i'm trying to do. in place of int's I have sf::Time's. i then check if i should print them as microseconds, milliseconds, or seconds. then I print.
Last edited on May 1, 2015 at 5:18am
May 1, 2015 at 5:57am
Iterating through them is easier if you store them in an array (or some other container).
May 1, 2015 at 8:22am
you can only iterate through collections. If your data is all separate items then they will all need processing separately.
Last edited on May 1, 2015 at 8:23am
Topic archived. No new replies allowed.