In article <>,
says...
[ ... ]
> Subtracting or comparing pointers that do not point to parts of the
> same object is undefined behavior.
Close, but not quite right. The behavior is defined, but the result
is unspecified. If you do something like this:
int a, b;
if ( a < b)
std::cout << "A less than B";
else
std::cout << "A greater than or equal to B";
It's entirely open to question _which_ leg of the if statement will
execute, but you basically get normal execution: one leg or the other
will execute, and things proceed normally from there. Undefined
behavior would mean absolutely _anything_ could happen from there
out.
--
Later,
Jerry.
The universe is a figment of its own imagination.