To loop through a class you must put them in either an array or a list of some kind, such as a vector:
Been a while since I did C++ so might not be exact. The big headache in C++ is the memory management. Search for how to use Vectors which are easier to use and have some auto-memory management.
Class* classarray = new Class[n]; for (int i = 0; i < 5; i++) classarray[n]...; //MUST do this at the end of your program delete classarray;
Been a while since I did C++ so might not be exact. The big headache in C++ is the memory management. Search for how to use Vectors which are easier to use and have some auto-memory management.