Saturday, April 28, 2012

9.10

Suppose that we were to try to write a short-circuit version of and in C as the following function:

Int and (int a, int b)

{
return a ? b : 0
}



(a) Why doesn't this work?

It will evaluate both terms no matter what, which is not short circuiting

No comments:

Post a Comment