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() function compares, 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() but uses ANSI/ISO naming conventions.
An integer, with the value given below:
#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/ISO naming conventions.
Safety: | |
---|---|
Interrupt handler | Yes |
Signal handler | Yes |
Thread | Yes |
memchr(), memcmp(), memcpy(), memset()