I am getting an error message when i am trying to initialize an array.
1 2 3 4 5 6 7 8 9 10
int rute(int goalx , int goaly , int startx , int starty , int **array )
{
int x = startx;
int y = starty;
int state= 0;
int decision[4] = {0};
decision = {array[x+1][y], array[x-1][y],array[x][y+1],array[x][y-1]};
//Error ^^
return state
}
decision = {array[x+1][y], array[x-1][y],array[x][y+1],array[x][y-1]};
you can only use intializer list on arrays for intialization not assigning, assign to an array like this is illegal;
you could simply intialize the array directly with the ntializer list