multi dimensional vectors
Hi i was wondering if it was possible to set a specific value in a vector. ill explain what i mean in arrays, if you could please show me the vector equivelent.
first i declare my multidimensional array / vector
Tile tiles[50][50]; OR vector<vector<Tile> > tiles;
next i have a loop to loop thru each element and initialise it.
array version:
Code:
for(int j = 0; j < mapHeight; j++){
for(int i = 0; i < mapWidth; i++){
tiles[i][j].init();
}
}
how would i perform this action on a multidimensional vector. baring in mind that i need to set that specific x/y value.
i tried the above with vectors but it doesnt seam to work.
any help will be great as i cant find much on vectors containing objects on the internet.
rob