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


Global Variables and Objects

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