What does this warning mean (i
and j
are not constants):
I have been trying to Google this but it does not give me any results.
The other answers have already explained the core problem. You can use:
if ( ( ( 0 <= i) && (i <= 10)) && ( ( 0 <= i) && (i <= 10)) )
to resolve your problem.
My recommendation will be to wrap that logic in a function.
int isInRange(int x, int lower, int upper)
{
return (lower <= x && x <= upper);
}
and use
if ( isInRange(i, 0, 10) && isInRange(j, 0, 10) )