Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Borland C++ 2.x ( with Turbo C ) - <b>strset() set all characters in string</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 strset()                Set All Characters in String

 #include   <string.h>                   Required for declarations only

 char       *strset(string,c);
 char       *string;                     String to be set
 int        c;                           Character to set to

    strset() sets all of the characters in 'string' (except the
    terminating null character) to 'c'.

       Returns:     A pointer to the altered string.  There is no error
                    return.

         Notes:     Use strnset() to set a specified number of characters
                    in a string.

   -------------------------------- Example ---------------------------------

    The following statements set all the characters in 'string' to 'X'.

           #include <string.h>
           #include <stdio.h>

           char string[30] = "abcdefghijklmnopqrstuvwxyz";

           main()
           {
               strset(string,'X');
               printf("%s\n",string);
           }


See Also: strnset()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson