Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Microsoft C 6.0 - <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 characters in 'string' to 'c'.  The terminating
    null character is not included.

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

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

 Portability:   Applies to MS DOS only.

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

    The following statement sets all the characters in 'string' to 'X'.

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

           char string[40] = "abcdefghijklmnopqrstuvwxyz";

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


See Also: strnset()

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