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 Library Reference - <u>synopsis:</u> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Synopsis:
    #include <string.h>
    int memcmp( const void *s1,
                const void *s2,
                size_t length );
    int _fmemcmp( const void __far *s1,
                  const void __far *s2,
                  size_t length );

Description:
    The memcmp function compares the first length characters of the object
    pointed to by s1 to the object pointed to by s2.

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

Returns:
    The memcmp function returns an integer less than, equal to, or greater
    than zero, indicating that the object pointed to by s1 is less than,
    equal to, or greater than the object pointed to by s2.

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

    void main()
      {
        auto char buffer[80];

        strcpy( buffer, "world" );
        if( memcmp( buffer, "Hello ", 6 ) < 0 ) {
          printf( "Less than\n" );
        }
      }

Classification:
    memcmp is ANSI, _fmemcmp is not ANSI

Systems:
     memcmp - All, Netware

    _fmemcmp - All

See Also:
    memchr, memcpy, memicmp, memset

See Also:

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