December 2005
Beginner to intermediate
618 pages
20h 19m
English
wmemcmp
Compares two blocks of wide characters
#include <wchar.h> intwmemcmp( const wchar_t * restrictb1, const wchar_t * restrictb2, size_tn);
The wmemcmp() function
compares the contents of two memory blocks of
n wide characters, beginning at the
addresses in b1 and
b2, until it finds a pair of wide
characters that don’t match. The function returns a value greater
than 0 if the mismatched wide character is greater in b1, or less than 0 if the first mismatched
wide character is greater in b2,
or 0 if the two buffers are identical over
n wide characters.
#define BUFFERSIZE 4096
wchar_t first[BUFFERSIZE] = { L'\0' };
wchar_t second[BUFFERSIZE] = { L'\0' };
/* ... read some data into the two buffers ... */
if (wmemcmp( first, second, BUFFERSIZE ) == 0 )
printf( "The two buffers contain the same wide-character text.\n" );Read now
Unlock full access