Serve Laurijssen wrote:
>
"copx" <co**@gazeta.plwrote in message
news:eo**********@inews.gazeta.pl...
If I had an if statement like this:
if (foo() || bar()) {
..
Would bar() be executed if foo() returned true?
No, this is called short circuit evaluation.
Once it is 100% certain whether the if statement will evaluate to
1 or 0 the expression is done
.... which permits things like
if ( pt != NULL && *pt == something )
and you are guaranteed that pt will not be dereferenced if pt is NULL.
--
+-------------------------+--------------------+-----------------------+
| Kenneth J. Brody |
www.hvcomputer.com | #include |
| kenbrody/at\spamcop.net |
www.fptech.com | <std_disclaimer.h|
+-------------------------+--------------------+-----------------------+
Don't e-mail me at: <mailto:Th*************@gmail.com>