文献来源:网站http://en.cppreference.com
void * memset ( void * ptr, int value, size_t num );
Fill block of memory
Sets the first num bytes of the block of memory pointed by ptr to the specified value (interpreted as an unsigned char).
填充内存块
用指定的值(一个无符号数据类型)来设置指定指针ptr的前num个字节的内存块
参数含义
ptr
Pointer to the block of memory to fill.
ptr:指定指针的内存块来填充
value
Value to be set. The value is passed as an int, but the function fills the block of memory using the unsigned char conversion of this value.
value:设置的值。该值的类型为一个int类型,但这个函数会把这个值转换为无符号的char类型的值来填充内存块
num
Number of bytes to be set to the value.
size_t is an unsigned integral type
num:规定多少个数字个字节来设置value
size_t是一个无符号的完整的字节
该函数可以理解为“内存设置”,把一个内存块的前num个字节填充为规定value。

如上图的例子,这个函数把str数组的前六个字节改成了‘-’
该文案仅为作者的自己想法,是网站的粗略翻译,如果有语言不妥,欢迎指出