Jerry Eckert wrote:

> The book I'm using ("Practical C Programming" from O'Reilly) states simply
> that strcmp() returns 0 if the strings match and non-zero otherwise.
...
> I find it interesting the book didn't provide a full description of the
> return value.  Is this a non-standard feature?

It's a "standard" feature actually.  O'Reilly aren't "wrong" strictly
speaking, they just left out a potentially interesting detail.  I can
only guess at the reason(s) for the omission...  In my experience it's
much more common to use strcmp() to test two strings equality than it is
to compare them lexicographically (my experience being that of a
kernel/network/driver person.)

Here's a good on-line reference to the Standard C Library:

http://www.dinkumware.com/htm_cl/

Bill (P.J.) Plauger also has a book by the same name (The Standard C Library),
published by Prentice Hall.  ISBN 13-131509-9.


The scope and behavior of what's called the "standard C library" were codified
some years ago, along with the behavior of a "standard" C compiler.



        -- Farrell

**********************************************************
To unsubscribe from this list, send mail to
[EMAIL PROTECTED] with the following text in the
*body* (*not* the subject line) of the letter:
unsubscribe gnhlug
**********************************************************
  • strcmp() Jerry Eckert
    • Re: strcmp... Farrell Woods
      • Re: st... Jon 'maddog' Hall, Executive Director, Linux International
        • Re... Jerry Feldman
          • ... Jon 'maddog' Hall, Executive Director, Linux International
            • ... Jerry Feldman
              • ... Jon 'maddog' Hall, Executive Director, Linux International
                • ... Jerry Feldman
      • Re: st... Derek Martin

Reply via email to