1.需要头文件
在C中 <string.h>
在C++中 <cstring>
2.函数解释
void *memset(void *s, int ch, size_t n);
函数解释:将 s 中后 n 个字节 (typedef unsigned int size_t)用 ch 替换并返回 s 。
memset:作用是在一段内存块中填充某个给定的值,它是对较大的结构体或数组进行清零操作的一种最快方法。