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>strnset() initialize n characters of string</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 strnset()               Initialize n Characters of String

 #include   <string.h>                   Required for declarations only

 char          *strnset(string,ch,n);
 char          *string;                  String to be initialized
 int           ch;                       Character setting
 size_t        n;                        Number of characters to be set

    strnset() sets the first 'n' bytes of 'string' to the character 'ch'.
    The length of 'string' is used instead of 'n' if 'n' is greater than
    the length of 'string'.

    Returns:    A pointer to the initialized string.

      Notes:    Use strset() to set all of the characters in 'string'.

 Portability:   Applies to MS DOS only.

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

    The following statement initializes a string to zeros.

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

           char string[50] = "ACME Software Co";
           int i;
           char *strptr;

           main()
           {
               strptr = strnset(string,'X',4);
               printf("COMPANY: %s",strptr);
           }


See Also: strset()

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