Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Watcom C Library Reference - <u>synopsis:</u> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Synopsis:
    #include <mbstring.h>
    int _mbsnbcmp( const unsigned char *s1,
                   const unsigned char *s2,
                   size_t n );
    int _fmbsnbcmp( const unsigned char __far *s1,
                    const unsigned char __far *s2,
                    size_t n );

Description:
    The _mbsnbcmp lexicographically compares not more than n bytes from the
    string pointed to by s1 to the string pointed to by s2.

    The function is a data model independent form of the _mbsnbcmp function
    that accepts far pointer arguments.  It is most useful in mixed memory
    model applications.

Returns:
    The _mbsnbcmp function returns an integer less than, equal to, or
    greater than zero, indicating that the string pointed to by s1 is less
    than, equal to, or greater than the string pointed to by s2.  _mbsnbcmp
    is similar to  _mbsncmp, except that _mbsnbcmp compares strings by bytes
    rather than by characters.

Example:
    #include <stdio.h>
    #include <mbctype.h>
    #include <mbstring.h>

    const unsigned char str1[] = {
        0x81,0x40, /* double-byte space */
        0x82,0x60, /* double-byte A */
        0x00
    };

    const unsigned char str2[] = {
        0x81,0x40, /* double-byte space */
        0x82,0xA6, /* double-byte Hiragana */
        0x83,0x42, /* double-byte Katakana */
        0x00
    };

    void main()
      {
        _setmbcp( 932 );
        printf( "%d\n", _mbsnbcmp( str1, str2, 3 ) );
      }

    produces the following:

    0

Classification:
    WATCOM

Systems:
     _mbsnbcmp - DOS, Windows, Win386, Win32, OS/2 1.x(all), OS/2-32

    _fmbsnbcmp - DOS, Windows, Win386, Win32, OS/2 1.x(all), OS/2-32

See Also:
    _mbsnbcat, _mbsnbicmp, strncmp, strnicmp

See Also:

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson