|
The easiest way to create this using arrays, would be to know exactly how many classes/houses/students/games and then staticaly initialize the needed amount of memory, else you'll end up with a program that could have unpredictable outcomes, since you most likely at some point will use uninitialized memory which will overwrite and disturb other parts of your running code.
That is avoided when using vectors, since they have their own memory handler, which makes sure the needed memory is available and that you're not off by one in your indexing of the arrays.
Once I'll come up with some code for this, you can expect it to be in C, not C++, since I am at my best with this type of memory handling in strict C.
I will look closer at this during the weekend, but I would also like to see some code fragments from you, so I know where you stand. Right now it seems as if I'm the only one comming up with idears to a solution for this.
|