delorie.com/djgpp/doc/libc/libc_569.html   search  
libc.a reference

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

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/ISO C C89; C99
POSIX 1003.2-1992; 1003.1-2001

Example

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


  webmaster     delorie software   privacy  
  Copyright © 2004     Updated Apr 2004