Hi,

>> Huh ... but strcmp will stop comparing at the end of any of the two
>> strings anyway.
>
> No, that's not true. If that were the case then string "abc" would be
> equal to string "ab", and strcmp knows that they are different (I
> tested this to be sure; it returns 99, while strcmp("abc", "abc")
> returns 0, as it should). I even tested this adding a new line onto
> one of the strings and strcmp reads them both through completely and
> tests that, not just the length of the shortest string.

Sorry I wasn't clear.

I didn't mean that it will return a match. I meant that it will stop
scanning through the strings as soon as one ends.
Whatever the result of the last comparaison it did will be used to
determine the return value.
In the case of "ab" vs "abc" the last comparaison is between '\0' and 'c'.

Cheers,

   Sylvain

_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Reply via email to