Jump to content
  • Advertisement

Archived

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

Teric

Global Variables and Objects

This topic is 5965 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
Advertisement

  • 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!