strset

Fills a string with a specified character

Local Servers:nonblocking
Remote Servers:N/A
Classification:Other
Service:String Manipulation

Syntax

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

Parameters

s1
(IN) Points to the string to be filled with the specified character.
fill
(IN) Specifies the character to be used in filling the string.

Return Values

The address of the original string s1 is returned.

Remarks

strset fills the string s1 with the character fill. The terminating NULL character in the original string remains unchanged.

See Also

strnset

Example

  #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  
  ===============  
  ***************