Share via


_memicmp (Windows CE 5.0)

Send Feedback

Developing an Application > Microsoft C Run-time Library for Windows CE > Run-time Library Reference

Compares characters in two buffers (case-insensitive).

int _memicmp(    const void*buf1,    const void*buf2,    unsignedintcount);

Parameters

  • buf1
    First buffer.
  • buf2
    Second buffer.
  • count
    Number of characters.

Return Values

The return value indicates the relationship between the buffers.

Return Value Relationship of First count Bytes of buf1 and buf2
< 0 buf1 less than buf2
0 buf1 identical to buf2
> 0 buf1 greater than buf2

Remarks

The _memicmp function compares the first count characters of the two buffers buf1 and buf2 byte by byte.

The comparison is not case sensitive.

Example

/* MEMICMP.C: This program uses _memicmp to compare
 * the first 29 letters of the strings named first and
 * second without regard to the case of the letters.
 */

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

void main( void )
{
   int result;
   char first[] = "Those Who Will Not Learn from History";
   char second[] = "THOSE WHO WILL NOT LEARN FROM their mistakes";
   /* Note that the 29th character is right here ^ */

   printf( "Compare '%.29s' to '%.29s'\n", first, second );
   result = _memicmp( first, second, 29 );
   if( result < 0 )
      printf( "First is less than second.\n" );
   else if( result == 0 )
      printf( "First is equal to second.\n" );}
   else if( result > 0 )
      printf( "First is greater than second.\n" );
}

Output

Compare 'Those Who Will Not Learn from' to 'THOSE WHO WILL NOT LEARN FROM'
First is equal to second.

Requirements

OS Versions: Windows CE 2.0 and later.
Header: stdlib.h.
Link Library: coredll.dll.

See Also

_memccpy | memchr | memcmp | memcpy | memset

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.