Original Post
Can I declare an array like this:
int myArray[100];And then access the 30th element like this?:
myArray[3][10]Also, can I do something like this:
int * myArray; myArray = malloc(sizeof(int)*100);And then access the 30th int like this?:
myArray[3][10];The reason I ask is because I want to create a simply game with a map made of tiles. I will create a tile object and then create a 2D array of these tile objects to represent the map. However, different levels in the game will require different map sizes, so I want to be able to allocate the memory for the map currently in play dynamically, but also have the benifit of the 2D array. Would the following work? int * myArray = new int[x][y]; ---signature--- People get ready. I''m ready to play.
