memset()
memset()函数原型是extern void *memset(void *buffer, int c, int count),其中buffer为指针或是数组 ,c是赋给buffer的值,count是buffer的长度.。头文件 string.h
举例:
int d[10000];
memset(d,0,sizeof(d)); //给数组d中内容全部赋值为0
常见错误:memset不能过度使用,其按字节赋值
memset()
memset()函数原型是extern void *memset(void *buffer, int c, int count),其中buffer为指针或是数组 ,c是赋给buffer的值,count是buffer的长度.。头文件 string.h
举例:
int d[10000];
memset(d,0,sizeof(d)); //给数组d中内容全部赋值为0
常见错误:memset不能过度使用,其按字节赋值