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 char *_mbputchar( unsigned char *mbstr,
                               unsigned int dbch );
    unsigned char far *_fmbputchar( unsigned char far *mbstr,
                                    unsigned int dbch );

Description:
    The _mbputchar function places the next single- or double-byte character
    specified by dbch at the start of the buffer specified by mbstr.

    The function is a code and data model independent form of the _mbputchar
    function.  It accepts far pointer arguments and returns a far pointer.
     It is most useful in mixed memory model applications.

Returns:
    The _mbputchar function returns a pointer to the next location in which
    to store a character.

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

    void main()
      {
        unsigned int c;
        unsigned char *str1;
        unsigned char *str2;
        unsigned char buf[30];

        _setmbcp( 932 );
        str1 = "ab\x82\x62\x82\x63\ef\x81\x66";
        str2 = buf;

        for( ; *str1 != '\0'; ) {
            str1 = _mbgetcode( str1, &c );
            str2 = _mbputchar( str2, '<' );
            str2 = _mbputchar( str2, c );
            str2 = _mbputchar( str2, '>' );
        }
        *str2 = '\0';
        printf( "%s\n", buf );
      }

    produces the following:

    <a><b>< C>< D><e><f>< G>

Classification:
    WATCOM

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

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

See Also:
    _mbsnccnt, _mbgetcode

See Also:

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