I'm trying to set an array as an input parameter to a self-made function, in which I want to modify the values of the array. For that, I tried to set the input array in the definition of the function as a pointer, but gave me some trouble.
The part of the *.hpp file can be seen here:
void CrossWall(int, int, bool[]);
The part of the *.cpp file is the next one:
void NODE::CrossWall(int robot_x, int robot_y, bool done_checking[]){
if (((robot_x+1) > (current_map.CheckLength() - 1)) && !done_checking[3] ){
available_movements[3] = 0;
done_checking[3] = true;
}
if (((robot_x-1) < 0 ) && !done_checking[2]){
available_movements[2] = 0;
done_checking[2] = true;
}
if (((robot_y+1) > (current_map.CheckHeight() - 1)) && !done_checking[0]){
available_movements[0] = 0;
done_checking[0] = true;
}
if (((robot_y-1) < 0 ) && !done_checking[1]){
available_movements[1] = 0;
done_checking[1] = true;
}
}
The array I want to modify is the array of bools (the only one there).