I couldn't figure out how to resolve the decadence to pointers of the first element in arguments of type array on my code:
class environment
{
private:
struct espacoFisico // Limite das coordenadas reais no objeto
{
double long absoluteX, absoluteY, absoluteZ;
std::vector <struct globalTile> tensor(std::vector<struct globalTile>x(std::vector<struct globalTile> y));
espacoFisico()
{
for (double long buildingX = 0; buildingX < absoluteX; ++buildingX)
{
for (double long buildingY = 0; buildingY < absoluteY; ++buildingY)
{
for(double long buildingZ = 0; buildingZ < absoluteZ; ++buildingZ)
{
this->tensor[buildingX][buildingY][buildingZ].emplace_back(globalTile());
};
};
};
};
};
So I'm getting what every newbie seems to get when trying to learn how to use a dynamic multidimensional vector of vectors:
environment.cpp: In constructor 'environment::espacoFisico::espacoFisico()':
environment.cpp:95:51: error: invalid types '<unresolved overloaded function type>[long double]' for array subscript
this->tensor[buildingX][buildingY][buildingZ].emplace_back(globalTile());
^
How would I be able to apply this (i.e. initialize the vector in the constructor), if I need the multidimensional vector called 'tensor' to be a member of the struct which is a member of the class?