heres the code: (function)
bool ValidMoveCheck (int row, int row1, int column, int column1)
{
bool check = false;
if (abs(row) - (row1) == 1)
{
check = true;
return check;
}
else if (abs(column) - (column1) == 1)
{
check = true;
return check;
}
else
{
cout << "Please enter valid row number/column number." << endl;
check = false;
return check;
}
}
the problem has to be about abs....i dunno why its not working....thanks in advance
Last edited on
i just want it to take the absolute value of 2 inputs that the user types....
Not sure why you are getting the error. I'm in Windows right now w/no access to compiler, and it's too late for me to look it up.
std::max( x, -x ) would give you the absolute value.