first post in stack overflow
I'm trying to create a structure where its size is determined by the inputs of the function but i get the errors:
error C2131 :expression did not evaluate to a constant
failure was caused by a read of a variable outside its lifetime
see usage of 'X_Max' and 'Y_Max'
TMap<FVector2D, FVector4> UMaze_Generator::GenerateMaze(const int X_Max,const int Y_Max,int Algorithm_Type)
{
struct FBlocks
{
//Properties of each block
int X_Loc;
int Y_Loc;
bool bNorth_Wall;
bool bSouth_Wall;
bool bWest_Wall;
bool bEast_Wall;
bool bStart_Point;
bool bEnd_Point;
bool bVisited;
}Maze[X_Max][Y_Max]; // Error caused by this
I tried searching for an answer but i couldn't find something relatable
any ideas what i'm doing wrong here ?
Thanks a lot
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…