Jump to content
  • Advertisement


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


Quick question on address operators, piece of cake

This topic is 6202 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

[script] typedef struct BLAH{ int member; }BLAH; ... BLAH bla; function(&bla); ... void function(BLAH *p) { *p.member=333; } [/script] The idea is to pass the address of a struct to a function so that the structure''s members can be altered from within the function. *p should point to the adress [script] int intfigure; int *intpointer; intpointer = &intfigure; *intpointer = 5; /*5 -> address stored in intpointer -> intfigure => intfigure = 5*/ /*That''s what I''m basicly trying to do, except with a structure and inside a function, which apparently holds some different rules*/ [/script] , but the comiler says that "request for member ''whatever'' in something not a structure or a union". So obviously I''m doing somethig wrong... Hope someone has the time to tell me what it is. Thanks.

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!