strset
Fills a string with a specified character
#include <string.h>
char *strset (
char *s1,
int fill);
The address of the original string s1 is returned.
strset fills the string s1 with the character fill. The terminating NULL character in the original string remains unchanged.
#include <string.h>
#include <stdio.h>
char source[ ] = {"A sample STRING"};
main ()
{
printf ("%s\n", source);
printf ("%s\n", strset (source, ’=’) );
printf ("%s\n", strset (source, ’*’) );
}
produces the following:
A sample STRING =============== ***************