Go to the first, previous, next, last section, table of contents.


memset

Syntax

#include <string.h>

void *memset(void *buffer, int ch, size_t num);

Description

This function stores num copies of ch, starting at buffer. This is often used to initialize objects to a known value, like zero.

Note that, although ch is declared int in the prototype, memset only uses its least-significant byte to fill buffer.

Return Value

buffer

Portability

ANSI, POSIX

Example

struct tm t;
memset(&t, 0, sizeof(t));


Go to the first, previous, next, last section, table of contents.