memicmp, _memicmp, _fmemicmp

compare a given number of characters of two objects, without case sensitivity

Synopsis:

#include <string.h>
int memicmp( const void *s1,
             const void *s2,
             size_t length );
int _memicmp( const void *s1,
              const void *s2,
              size_t length );
int _fmemicmp( const void __far *s1,
               const void __far *s2,
               size_t length );

Description:

The memicmp() and _fmemicmp() functions compare, with case insensitivity (upper- and lowercase characters are equivalent), the first length characters of the object pointed to by s1 to those of the object pointed to by s2.

The _fmemicmp() function is a data-model-independent form of the memicmp() function that accepts far pointer arguments. It is most useful in mixed memory model applications.

The _memicmp() function is identical to memicmp(). Use _memicmp() for ANSI naming conventions.

Returns:

an integer, with the value given below:

less than 0
the object pointed to by s1 is less than the object pointed to by s2.
0
the object pointed to by s1 is equal to the object pointed to by s2.
greater than zero
the object pointed to by s1 is greater than the object pointed to by s2.

See also:

memchr(), memcmp(), memcpy(), memset()

Examples:

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

void main()
  {
    char buffer[80];

    strcpy( buffer, "World" );
    if( memicmp( buffer, "hello", 5 ) < 0 ) {
      printf( "Less than\n" );
    } else {
      printf( "Equal to or greater than\n");
    }
  }

produces the output:

Equal to or greater than

Classification:

WATCOM

_memicmp() conforms to ANSI naming conventions.

Systems:

memicmp()
All (except DOS/PM)
_memicmp()
All (except DOS/PM)
_fmemicmp()
All (except Netware, DOS/PM)