Parameters
-
dest
-
Pointer to destination.
-
c
-
Character to set.
-
count
-
Number of characters.
Remarks
Required hearder file
<string.h>
Examples
// crt_memset.c
/* This program uses memset to
* set the first four chars of buffer to "*".
*/
#include <string.h>
#include <stdio.h>
int main( void )
{
char buffer[] = "This is a test of the memset function";
printf( "Before: %s\n", buffer );
memset( buffer, '*', 4 );
printf( "After: %s\n", buffer );
}
Output
Before: This is a test of the memset function
Before: This is a test of the memset function
After: **** is a test of the memset function