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 _mbccmp( const unsigned char *s1,
                 const unsigned char *s2 );
    int _fmbccmp( const unsigned char __far *s1,
                  const unsigned char __far *s2 );

Description:
    The _mbccmp function compares one multibyte character from s1 to one
    multibyte character from s2.

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

Returns:
    The _mbccmp and functions return the following values.

    Value     Meaning

< 0
    multibyte character at s1 less than multibyte character at s2

0
    multibyte character at s1 identical to multibyte character at s2

> 0
    multibyte character at s1 greater than multibyte character at s2

    On an error,  _NLSCMPERROR is returned (defined in <string.h> and
    <mbstring.h>).


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

    unsigned char mb1[2] = {
        0x81, 0x43
    };

    unsigned char mb2[2] = {
        0x81, 0x42
    };

    void main()
      {
        int     i;

        _setmbcp( 932 );
        i = _mbccmp( mb1, mb2 );
        if( i == _NLSCMPERROR )
            printf( "Error in multibyte character\n" );
        else if( i < 0 )
            printf( "Less than\n" );
        else if( i == 0 )
            printf( "Equal to\n" );
        else
            printf( "Greater than\n" );

      }

    produces the following:

    Greater than

Classification:
    _mbccmp is ANSI, _mbccmp is not ANSI, _fmbccmp is not ANSI

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

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

See Also:
    _mbccpy, _mbcicmp, _mbcjistojms, _mbcjmstojis, _mbclen, _mbctohira,
    _mbctokata, _mbctolower, _mbctombb, _mbctoupper, mblen, mbrlen, mbrtowc,
    mbsrtowcs, mbstowcs, mbtowc, sisinit, wcrtomb, wcsrtombs, wcstombs,
    wctob, wctomb

See Also: _mbcjistojms _mbcjmstojis

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