strset(): setting chars of a string

We can set all chars of a string to one input string by using strset() string function.
strset(main_string, set_string);
#include<stdio.h>
#include<string.h>
int main()
{
   char str1[20] = "plus2net";
   char str2='*';
   printf("Original string : %s \n", str1);
   strset(str1,str2);
   printf("After  strset() : %s",str1);
   return 0;
}
The output of above code is here
Original string :plus2net
After strset() : ********
Your Rating




Post your comments , suggestion , error , requirements etc here




We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
©2000-2019 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer