#include
void *memset(void *s, int c, size_t n);
DESCRIPTION
The memset() function fills the first n bytes of the memory area pointed to by s with the constant byte c.
RETURN VALUE
The memset() function returns a pointer to the memory area s.
#include
void bzero(void *s, size_t n);
DESCRIPTION
The bzero() function sets the first n bytes of the byte area starting at s to zero (bytes containing '\0').
RETURN VALUE
None.
实例:
struct flock lock;
//用bzero清空
bzero(&lock,sizeof(struct flock));
//用memset清空
memset(&lock,0,sizeof(struct flock));
阅读(1854) | 评论(0) | 转发(0) |