1#include <stdio.h>
2#include <string.h>
3
4int main () {
5 char str[50];
6
7 strcpy(str,"This is string.h library function");
8 puts(str);
9
10 memset(str,'$',7);
11 puts(str);
12
13 return(0);
14}
1/* memset example */
2#include <stdio.h>
3#include <string.h>
4
5int main ()
6{
7 char str[] = "almost every programmer should know memset!";
8 memset (str,'-',6);
9 puts (str);
10 return 0;
11}
12
13// Output:
14// ------ every programmer should know memset!