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 <string.h>
    int _strncoll( const char *s1,
                   const char *s2,
                   size_t count );
    #include <wchar.h>
    int _wcsncoll( const wchar_t *s1,
                   const wchar_t *s2,
                   size_t count );
    #include <mbstring.h>
    int _mbsncoll( const unsigned char *s1,
                   const unsigned char *s2,
                   size_t count );

Description:
    These functions compare the first count characters of the string pointed
    to by s1 to the string pointed to by s2.  The comparison uses the
    current code page which can be selected by the  _setmbcp function.

    The _wcsncoll function is a wide-character version of _strncoll that
    operates with wide-character strings.

    The _mbsncoll function is a multibyte character version of _strncoll
    that operates with multibyte character strings.

Returns:
    These functions return 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, according to the
    collating sequence selected.  If an error occurs, these functions return
     _NLSCMPERR.  The  _wcsncoll function may set  errno to  EINVAL to
    indicate that either string contains characters outside of the collating
    sequence of the current code page.

Example:
    #include <stdio.h>
    #include <string.h>

    char buffer[80] = "world";

    void main()
      {
        _setmbcp( 932 );
        if( _strncoll( buffer, "Hello" ) < 0 ) {
            printf( "Less than\n" );
        }
      }

Classification:
    WATCOM

Systems:
     _strncoll - All, Netware

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

See Also:
    _setmbcp, strcoll, stricmp, _stricoll, strncmp, strnicmp, _strnicoll

See Also: _setmbcp

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