Consider this:
int f() {
puts("F was called\n");
return 0;
}
int g() {
puts("G was called\n");
return 0;
}
int h() {
puts("H was called\n");
return 1;
}
int main() {
int res1 = (f() && g()) || h();
int res2 = f() && (g() || h());
return 0;
}
The order in which the functions are called will be: f, h for res1
and just f for res2
. The results will be res1 = 1
and res2 = 0
. There is no way to parenthesize the expressions, so that "G was called" or "H was called" would be printed before "F was called".