View Single Post
Old 06-08-2006, 10:18 AM   #15
Vaskez
Takhisis Follower
 

Join Date: April 30, 2001
Location: szép Magyarország (well not right now)
Posts: 5,089
you should learn how to use the standard template library vectors, lists and maps. Maps are the only tricky ones to use. The main difference is that they can change size at run-time whereas arrays can't.

e.g. a vector of ints:

code:
#include <vector>

vector<int> stats;

\\adding stuff:

stats.push_back(5);

\\then you can go through it by creating an iterator:

vector<int>::iterator it

\\and loop through:

for(it=stats.begin(); it != stats.end(); it++)
{
int i = *it;

}
[/QUOTE]can't remember other operations but I think you can erase like:

stats.erase(it); where it is the iterator pointing to a position in the vector

[ 06-08-2006, 10:20 AM: Message edited by: Vaskez ]
__________________
Too set in his ways to ever relate
If he could set that aside, there'd be heaven to pay
But weathered and aged, time swept him to grave
Love conquers all? Damn, I'd say that area's gray
Vaskez is offline   Reply With Quote