If you want a variable visible across multiple files, use extern:
// Globals.h extern int Data[10][10]; //Globals.cpp int Data[10][10];
However, it makes a lot more sense to load them from file. Even if you don't want to use standard library containers, loading and saving is trivial, and will help you to modify and add additional levels in the future. Also note that you will be able to supply an editor for maps.
Here's sample 2-dimensional C-style array serialization:
#include <fstream> int Data[SizeX][SizeY]; // save { // You can use binary mode too! ofstream File ("data.txt"); for (unsigned y = 0; y < SizeY; ++y) for (unsigned x = 0; x < SizeX ++x) // you'd need to change it to File.write(...) when using binary mode. File << Data[x][y] << " "; } // load { ifstream File ("data.txt"); for (unsigned y = 0; y < SizeY; ++y) for (unsigned x = 0; x < SizeX ++x) File >> Data[x][y]; }
You might also want to add some sort of header to your file - containing map size, game version, author of the level etc. However, loading of this data is trivial and I leave it as an exercise :)
I'd also take a look at std::vector. Contrary to your belief, it's a lot easier to use than C-style arrays. It was designed to be!