Memset is used to set a buffer with a specific character for example memset (dptr, 'A', 10); // sets the first 10 character to character 'A'#include <memory.h>#include <stdio.h>
int main( void ){ char buffer[] = "This is a test of the memset function";
printf( "Before: %sn", buffer ); memset( buffer, '*', 4 ); printf( "After: %sn", buffer );}OutputBefore: This is a test of the memset functionAfter: **** is a test of the memset function