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>
    char *strnset( char *str, int fill, size_t count );
    char *_strnset( char *str, int fill, size_t count );
    char __far *_fstrnset( char __far *str,
                           int fill,
                           size_t count );
    #include <wchar.h>
    wchar_t *_wcsnset( wchar_t *str, int fill, size_t count );
    #include <mbstring.h>
    unsigned char *_mbsnset( unsigned char *str,
                             unsigned int fill,
                             size_t count );
    unsigned char __far *_fmbsnset( unsigned char __far *str,
                                    unsigned int fill,
                                    size_t __n );

Description:
    The strnset function fills the string str with the value of the argument
    fill, converted to be a character value.  When the value of count is
    greater than the length of the string, the entire string is filled.
     Otherwise, that number of characters at the start of the string are set
    to the fill character.

    The _strnset function is identical to strnset.  Use _strnset for ANSI
    naming conventions.

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

    The _wcsnset function is a wide-character version of strnset that
    operates with wide-character strings.  For _wcsnset, the value of count
    is the number of wide characters to fill.  This is twice the number of
    bytes.

    The _mbsnset function is a multibyte character version of strnset that
    operates with multibyte character strings.

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

    For _mbsnset, the value of count is the number of multibyte characters
    to fill.  If the number of bytes to be filled is odd and fill is a
    double-byte character, the partial byte at the end is filled with an
    ASCII space character.

Returns:
    The address of the original string str is returned.

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

    char source[] = { "A sample STRING" };

    void main()
      {
        printf( "%s\n", source );
        printf( "%s\n", strnset( source, '=', 100 ) );
        printf( "%s\n", strnset( source, '*', 7 ) );
      }

    produces the following:

    A sample STRING
    ===============
    *******========

Classification:
    WATCOM

Systems:
     strnset - All, Netware

    _strnset - All, Netware
    _fstrnset - All
    _wcsnset - All
    _mbsnset - DOS, Windows, Win386, Win32, OS/2 1.x(all), OS/2-32
    _fmbsnset - DOS, Windows, Win386, Win32, OS/2 1.x(all), OS/2-32

See Also:
    strset

See Also:

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