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>
    unsigned int _mbsnextc( const unsigned char *string );
    unsigned int _fmbsnextc(
                        const unsigned char __far *string );
    #include <tchar.h>
    unsigned int _strnextc( const char *string );
    unsigned int _wcsnextc( const wchar_t *string ) {

Description:
    The _mbsnextc function returns the integer value of the next
    multibyte-character in string, without advancing the string pointer.
     _mbsnextc recognizes multibyte character sequences according to the
    multibyte code page currently in use.

    The header file <tchar.h> defines the generic-text routine  _tcsnextc.
     This macro maps to _mbsnextc if  _MBCS has been defined, or to
    _wcsnextc if  _UNICODE has been defined.  Otherwise  _tcsnextc maps to
    _strnextc.  _strnextc and _wcsnextc are single-byte character string and
    wide-character string versions of _mbsnextc.  _strnextc and _wcsnextc
    are provided only for this mapping and should not be used otherwise.
     _strnextc returns the integer value of the next single-byte character
    in the string.  _wcsnextc returns the integer value of the next wide
    character in the string.

Returns:
    These functions return the integer value of the next character
    (single-byte, wide, or multibyte) pointed to by string.

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

    const unsigned char chars[] = {
        ' ',
        '.',
        '1',
        'A',
        0x81,0x40, /* double-byte space */
        0x82,0x60, /* double-byte A */
        0x82,0xA6, /* double-byte Hiragana */
        0x83,0x42, /* double-byte Katakana */
        0xA1,      /* single-byte Katakana punctuation */
        0xA6,      /* single-byte Katakana alphabetic */
        0xDF,      /* single-byte Katakana alphabetic */
        0xE0,0xA1, /* double-byte Kanji */
        0x00
    };

    void main()
      {
        _setmbcp( 932 );
        printf( "%#6.4x\n", _mbsnextc( &chars[2] ) );
        printf( "%#6.4x\n", _mbsnextc( &chars[4] ) );
        printf( "%#6.4x\n", _mbsnextc( &chars[12] ) );
      }

    produces the following:

    0x0031
    0x8140
    0x00a1

Classification:
    WATCOM

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

    _fmbsnextc - DOS, Windows, Win386, Win32, OS/2 1.x(all), OS/2-32
    _strnextc - MACRO
    _wcsnextc - MACRO

See Also:
    _mbsnextc, _strdec, _strinc, _strninc

See Also:

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