Skip to main content
gamedev.net
🔒 Locked

pointers in pointers

Started by Marty666 Jan 9, 2004 at 1:44 PM 1 replies 250+ views
Original Post
Marty666
Marty666
i have a problem with a pointer to myclass within myclass. you can see it in dosomething: class myclass // this is some class { myclass *somepointer // this is a pointer to another instance of the same class } void dosomething(myclass thisclass) { myclass temp **thisclass.myclass.myclass = temp // the value of temp should be put in the myclass within thisclass } as u see i put something in the memory that a pointer points within a memory that a pointer points to. when i use double **''s i get error C2228: left of ''.nextparticle'' must have class/struct/union type wow should i fix this?
_ /__ /|| | || MtY | ||_____|/Marty
ToohrVyk
ToohrVyk
(*(*thisclass).somepointer).somepointer

or more simply

thisclass->somepointer->somepointer

as a->b is equivalent to (*a).b

Marty666
Marty666
ty!
_ /__ /|| | || MtY | ||_____|/Marty

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.