I am new to C++ and I am having a trouble using pointers in function.
int old = Grid[x][y];
int new_one = Grid[x][y-1];
Crush_or_not = move(&old , &new_one);
y--;
Here I have a 2d array called Grid. I want to call a function called 'move'.
bool move(int *old_location, int *new_location)
{
if (*new_location == 1)
{
*new_location = 3;
*old_location = 1;
return true;
}
else
{
return false;
}
}
But the compiler returns an error:
error: no match for call to ‘(std::string {aka std::basic_string}) (int*, int*)’
So I don't quite understand why this would happen, can anyone help me?