|
||
|
GP Mailing List
ATXGPSIG List
|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: pointers
On Fri, 8 Sep 2000, Brian Holley wrote:
> my question is, is there a special notation I need to use? Because I think
> right now I'm discounting the fact that this is a POINTER to an array and
> not an array.
You may want to try out the stl instead. To do what you need to
with the stl you would:
stl::vector<OBJECTP> objects; //gives us an empty array of objects
OBJECTP objectToAdd;
objects.push_back( objectToAdd ); //adds an object to the end of the array
objects.size(); //gives us the size of the array
objects.pop_back(); //removes the last element
//Will run through the entire array and do ->someOperation();
for (int i=0;i<objects.size();i++)
{
objects[i]->someOperation();
}
--
Marc Hernandez
=================================================================
The GameProgrammer.Com mailing list is for the open discussion
of any topic related to the art, science, and business of
programming games. This list is especially tolerant of beginners.
We were all beginners once
To SUBSCRIBE or UNSUBSCRIBE please visit:
http://gameprogrammer.com/mailinglist.html
|
|