Set characters of a string to a character.
#include <string.h> | Required only for function declarations |
char *_strset( char *string, int c );
char __far * __far _fstrset( char __far *string, int c );
string | String to be set | |
c | Character setting |
The _strset function sets all of the characters of string to c (converted to char), except the terminating null character ('\0').
The _fstrset function is a model-independent (large-model) form of the _strset function. The behavior and return value of _fstrset are identical to those of the model-dependent function _strset, with the exception that the pointer arguments and return value are far pointers.
These functions return a pointer to the altered string. There is no error return.
_strset
Standards:None
16-Bit:DOS, QWIN, WIN, WIN DLL
32-Bit:DOS32X
_fstrset
Standards:None
16-Bit:DOS, QWIN, WIN, WIN DLL
32-Bit:None
memset, strcat, strcmp, strcpy, _strnset
/* STRSET.C */
#include <string.h>
#include <stdio.h>
void main( void )
{
char string[] = "Fill the string with something";
printf( "Before: %s\n", string );
_strset( string, '*' );
printf( "After: %s\n", string );
}
Before: Fill the string with something
After: ******************************