strset, _fstrset
raw OCR
Sets all characters in a string to a given character.
Defined in header <string.h>
Syntax
#include <string.h>
Near version: char *strset(char *s, int ch);
Far version: char far * far _fstrset(char far *s, int ch)
Portability
| DOS | UNIX | Windows | ANSI C | C++ only |
|---|---|---|---|---|
| ■ | ■ |
Remarks
strset sets all characters in the string s to the character ch. It quits when the terminating null character is found.
Return value
strset returns s.
See also
Example
#include <stdio.h>
#include <string.h>
int main (void)
{
char string[10] = "1234567
char symbol = 'c';
printf ("Before strset(): %s\n", string)
strset(string, symbol);
printf ("After strset(): %s\n", string)
return 0;
}
Differences from modern implementations
Nothing recorded yet.
Modern references
These are search links, not yet checked by hand.
Extraction notes
- heading `strset, fstrset` read as `strset, _fstrset`
Stable link: /3.1/string.h/strset/
· short form /3.1/strset/