compare a given number of characters of two objects, without case sensitivity
#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 );
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.
an integer, with the value given below:
memchr(), memcmp(), memcpy(), memset()
#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
WATCOM
_memicmp() conforms to ANSI naming conventions.