Mail Archives: djgpp/1997/08/09/05:05:38
Chris Croughton wrote:
>
> One of the most common uses of this is in testing array
> elements, as in:
>
> if (i >= 0 && i < 10 && a[i] != x)
> ...
And the second most common is probably to examine pointers for NULL
values before dereferencing them, as in:
if ( ptr != NULL && ptr->value == x )
...
And this too would break if the compiler did not evaluate left-to-right.
--
---------------------------------------------------------------------
| John M. Aldrich, aka Fighteer I | mailto:fighteer AT cs DOT com |
| Proud owner of what might one | http://www.cs.com/fighteer |
| day be a spectacular MUD... | Plan: To make Bill Gates suffer |
---------------------------------------------------------------------
- Raw text -