fill a string with a given character
#include <string.h> char *strset( char *s1, int fill ); char __far *_fstrset( char __far *s1, int fill );
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.
The address of the original string s1.
#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 =============== ***************
WATCOM
Safety: | |
---|---|
Interrupt handler | Yes |
Signal handler | Yes |
Thread | Yes |