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
unsigned int n; Number of characters to be set
strnset() sets at most the first 'n' bytes of 'string' to the
character 'ch'. If 'n' is greater than the length of 'string', then
the length of 'string' is used instead of 'n'.
Returns: A pointer to the initialized string.
Notes: Use strset() to set all of the characters in string.
-------------------------------- Example ---------------------------------
The following statement initializes a string to zeros.
#include <string.h>
char string[80];
main()
{
strnset(string,'\0',strlen(string));
}
Seealso:
This page last updated on Fri Nov 30 10:48:32 MSK 2001
Copyright © 1992-2001, Vitaly Filatov, Moscow, Russia
Webmaster