S S wrote:
> Dizzy, Ian
>
> May be I am missing something, but my statement
> strcmp(s1, s2) < 0
> will give me the expression
>
> return 0 < 0;
>
> which is FALSE. Am I correct?
Correct.
>
> if (0 < 0)
> cout << "Its true";
> else
> cout << "Its false";
>
> It prints, Its false.
So? I said 2 elements are equivalent iff (!(elem1 < elem2) && !(elem2 <
elem1)). Let's take your example, let's compare "a" and "b" so we have
!(strcmp("a", "b")<0) && !(strcmp("b", "a")<0) which means false && true
which yields false so "a" and "b" are not equivalent, BUT, let's take "a"
and "a" and we have:
!(strcmp("a", "a")<0) && !(strcmp("a", "a")<0) which is "true && true"
which
is true so "a" and "a" are equivalent elements acording to your given
predicate (strcmp(x,y) < 0).
--
Dizzy


|