Thread: Help
View Single Post
Old 07-21-2005, 01:51 AM   #12 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,712
redhead is on a distinguished road
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.
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote