Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

EGD Eric

How do I dereference a pointer that's a member of a class?

This topic is 5399 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I know how to dereference stuff, like make something else equal to what''s stored in whatever the pointer''s pointing to. Object *pointerToObject; Object something_else; something_else = *pointerToObject; Now if I have a pointer in a class, what do I do? variable = *(pointer->variable_thats_also_a_pointer) this gives me a compiler error.

Share this post


Link to post
Share on other sites
Advertisement
quote:
Original post by EGD Eric
variable = *(pointer->variable_thats_also_a_pointer)



uhm, you forgot the ; Besides that it should work. I've done it a million times.



My Site

[edited by - Quasar3D on February 5, 2004 7:37:10 PM]

Share this post


Link to post
Share on other sites
ur gunna have to be more specific dude...

like the actual error, and a whole segment of code.

from what you''ve given i can''t see any error.

Share this post


Link to post
Share on other sites
the compiler error could be because:
1) the member is private or protected.
2) you missed off the semi-colon.
3) the variable you are assigning to isn't of a correct type.

It would be better to post the actual code and the actual error message. That's important information that when we are solving our own problems we have in front of us.

[edited by - petewood on February 6, 2004 4:12:03 AM]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!