Three dimensional array of struct

Here is my struct:
1
2
3
4
5
6
struct Tile
{
	// Values
	int base;
	int object;
};


Here is the function:
1
2
3
4
5
int setup_map()
	{

		return 0;
	}


Now I want that whenever that function is called, the variable tilemap is freed and then defined again. It will be a three dimensional array containing Tiles. When it is declared I want it to be populated from some source. How to do this?
http://www.cplusplus.com/forum/articles/17108/
The article discusses various methods of implementing multidimensional arrays.
Topic archived. No new replies allowed.