|
||
|
GP Mailing List
ATXGPSIG List
|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: pointers
i dont see anything wrong with the code you wrote, but if you want you could always try: *(WorldObjects[x]).structElement or (WorldObjects + x * sizeof(WorldObjects))->structElement or *(WorldObjects + x * sizeof(WorldObjects)).structElement what you wrote plus those three above should (theoretically) give the same results. --Bill ----- Original Message ----- From: "Brian Holley" <comp_brain@hotmail.com> To: <gameprogrammer@gameprogrammer.com> Sent: Friday, September 08, 2000 2:17 PM Subject: pointers > Hey everybody. > > I'm having some problems with some work I'm trying to do with pointers. > Basically I think it boils down to how I'm trying to reference a pointer to > an array of pointers. I'm trying to do this: > > OBJECTP * WorldObjects = new OBJECTP[NumObjects]; > > where OBJECTP is a pointer to my object struct and NumObjects in the number > of objects in the scene. I trying to reference this array like this: > > WorldObjects[x]->...; > > 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. > > Any help on this subject will be very much appreciated. > Thanks. > > -Brian > _________________________________________________________________________ > Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. > > Share information about yourself, create your own public profile at > http://profiles.msn.com. > > ================================================================= > 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 > > ================================================================= 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
|
|