Я пытался создать двухмерный массив векторов для игры.Вот пример того, что я делаю.
struct TILE {
int a;
char b;
bool c;
};
TILE temp_tile;
std::vector<TILE> temp_vec_tile;
std::vector<std::vector<TILE>> tile;
for (int x = 0; x < 10; x++) {
for (int y = 0; y < 10; y++) {
temp_tile.a = x;
temp_tile.b = "a";
temp_tile.c = false;;
temp_vec_tile.push_back(temp_tile);
}
tile.push_back(temp_vec_tile);
}
// Why does this not work?
int x = tile[3][5].a;
Примечание: я не хочу использовать Boost для этого.
Спасибо