Sep 2, 2009 at 5:23am UTC
(it's 1:15am est, after a long day...)
I want to create random amounts of objects at a time, store them in an array and be able to search through the array for certain object properties.
I think I should be using a linked list or vectors...what would be better? I realize some type of pointer will be my way out of this problem.
Also, when I add a random amount of objects would it be more like:
1 2 3 4 5 6 7 8 9
void createobject()
{
class object;
push_into_array;
};
main()...
for (int x=0;x<random_int;x++)createobject();
...
or
class object_array[random_int];
I know right now I'm just looking for an easy way out of reading about linked lists, but if there's no replies after I wake up. Then, that's surely what I'll do.
Last edited on Sep 2, 2009 at 5:24am UTC
Sep 2, 2009 at 6:46am UTC
std::vector > arrays. Also, your array syntax is wrong, but that's beside the point.
Sep 2, 2009 at 8:54am UTC
what do you mean? have a random number generator inside of the object array class?
as in
class object_array[function(get_random_number)];
hey whats a vector?