memset函数

来源:互联网 发布:淘宝紫砂壶哪家靠谱 编辑:程序博客网 时间:2024/06/09 22:58

头文件:<string.h>/<cstring>

函数原型:

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所指向的某一块内存中的每个字节的内容全部设置为value指定的ASCII值, 块的大小由第三个参数指定,这个函数通常为新申请的内存做初始化工作, 其返回值为指向S的指针。

0 0
原创粉丝点击