• Advertisement
Sign in to follow this  

Accessing other members, the best method? (wxWidgets)

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

This isn't wxWidgets specific, but it's currently what I'm doing. Here's my issue (that i've run into alot, with general C++ programming).

class SomeClass
int *m_iPointer;
exterm SomeClass *myGlobalPointer;

In "File2.cpp" I need to access "m_iPointer" this is how I do it now:



When coding with any API (sfml/sdl/wxwidgets) I always have a "main/master" class that's exposed to a global object, and I access everything from there.
Is this *okay*? or if there's really no other way, does wxWidgets provide me a better way? I know the event system, but that doesn't help to much.


Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement