[Previous]
[Contents]
[Next]

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() function fills 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's most useful in mixed memory model applications.

Returns:

The address of the original string s1.

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

Safety:
Interrupt handler Yes
Signal handler Yes
Thread Yes

See also:

strnset()


[Previous]
[Contents]
[Next]