Home >>C String functions >C strset() function
C strset() function set all the characters in a string to given character.
Syntax:Strset(str,char)
Note:- Here str is given string.
It takes string and character as parameter.
It returns modified string.
Example-1
#include <stdio.h>
#include <string.h>
int main()
{
char str[20] = "String";
printf("Original string is : %s", str);
printf("Test string after strset() : %s",strset(str,'#'));
printf("After string set: %s",str);
return 0;
}