Given two conditions with an &&
connection. I know that the order of evaluation is from left to right. But if the first condition resolves to false, it the second condition guaranteed to not get evaluated?
#define SIZE
bool array[SIZE];
int index;
// play with variables
// ...
if(index < SIZE && array[index])
{
// ...
}
In this example, if the first condition is false the second must not be evaluated since the access in the array would be out of range.
By the way I cannot simply nest the conditionals with two if
statements, since actually I need the inverse like (!(in_range && get_element))
. With nested statements I would need to use goto
to jump over the code block below that.