I allocate memory using an allocator, which gives me a linear address space. Then I write a macro which indexes into that allowing (x, y, z) type subscript notation. So far, in my C++ code, I've never needed to go beyond three dimensional arrays, and so I have code I could help you with to index into two and three dimensional arrays.
In my work I occasionally need four dimensional arrays, but I haven't yet taken the time to work that macro out in C/C++ syntax. I also code in PowerBASIC, and I believe that language allows up to 8 dimensions, dynamically allocated. In the app that needs four dimensional arrays, I used PowerBASIC.
If you want help or examples wit two or three dimensional arrays, let me know.
As far as I know, the issue with C and C++ is that all of the dimensions can't be allocated at run time. If I'm wrong about that, I hope somebody will tell me too. I know I did spend some time researching this quite a few years ago, and gave up on it with C++. It's my understnding C++ coders use various capabilities from STL and such to deal with this issue, as kbw intimated.
probably due to my misunderstanding (sorry my english is really bad) but let me make sure we are on the same page. The map im talking about is literally, a map. If you had ever played any 2d rpg, you will see your character walk on a bunch of tiles putted together. Those "bunch" of tiles putted together. That is called a map. Plainly speaking, a map is simply a data (sort of like array) that store x and y (coordinate) number that represent a tile.
int MaxX, MaxY; // this represent the maximum x and maximum y of a map;
(whatever im trying to do right here)
//the code goes here have to do with data storing, which i absolutely have no idea how to do this
Map(int maxx, int maxy);
//other function etc
i want to use multidimensional array as something like this:
then have a function that be like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
for (int y = 0; y < MaxY; y++)
for (int x = 0; x < MaxX; x++)
myTiles[x][y] = 0;
If you can please teach me to use multidimensional array. I only need to use 2 variables x and y.