strset, _fstrset

fill a string with a given character

Synopsis:

#include <string.h>
char *strset( char *s1, int fill );
char __far *_fstrset( char __far *s1, int fill );

Description:

The strset() and _fstrset() functions fill the string pointed to by s1 with the character fill. The terminating null character in the original string remains unchanged.

The _fstrset() function is a data-model-independent form of the strset() function. It accepts far pointer arguments, and returns a far pointer. It is most useful in mixed memory model applications.

Returns:

the address of the original string s1

See also:

strnset()

Examples:

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

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

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

produces the output:

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

Classification:

WATCOM

Systems:

strset()
All (except DOS/PM)
_fstrset()
All (except Netware, DOS/PM)