Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Watcom C/C++ v10.0 : C library - <b>synopsis:</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Synopsis:
    #include <string.h>
    int strcmp( const char *s1, const char *s2 );
    int _fstrcmp( const char __far *s1,
                  const char __far *s2 );

Description:
    The strcmp and _fstrcmp functions compare the string pointed to by s1 to
    the string pointed to by s2.

    The _fstrcmp function is a data model independent form of the strcmp
    function that accepts far pointer arguments.  It is most useful in mixed
    memory model applications.

Returns:
    The strcmp and _fstrcmp functions return an integer less than, equal to,
    or greater than zero, indicating that the string pointed to by s1 is
    less than, equal to, or greater than the string pointed to by s2.

See Also:
    stricmp, _fstricmp, strncmp, _fstrncmp, strnicmp, _fstrnicmp

Example:
    #include <stdio.h>
    #include <string.h>

    void main()
      {
        printf( "%d\n", strcmp( "abcdef", "abcdef" ) );
        printf( "%d\n", strcmp( "abcdef", "abc" ) );
        printf( "%d\n", strcmp( "abc", "abcdef" ) );
        printf( "%d\n", strcmp( "abcdef", "mnopqr" ) );
        printf( "%d\n", strcmp( "mnopqr", "abcdef" ) );
      }

    produces the following:

    0
    1
    -1
    -1
    1

Classification:
    strcmp is ANSI, _fstrcmp is not ANSI

Systems:
     strcmp - All

    _fstrcmp - All

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson