Archived

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

Global Variables and Objects

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

Yep, here I am, another newbie making a Tetris clone (please don''t shoot me) I''m wondering how to make a global array visible to an object. I have this array declared in my Main.cpp file:
int PlayArea[10][25]; 
I also have a Shape object, and I want the contents of the PlayArea array to be visible to my Shape object. I suppose I could extern the global array in the Shape.h file, but that just doesn''t seem like good coding practice to me. is there a better way to do this?

Share this post


Link to post
Share on other sites