Keil Logo Arm Logo

memset

Summary
#include <string.h>

void *memset (
  void *buf,           /* buffer to initialize */
  unsigned char c,     /* byte value to set */
  unsigned int len);   /* buffer length */
Description

The memset function sets the first len bytes in buf to c.

Return Value

The memset function returns dest.

See Also

memccpy, memchr, memcmp, memcpy, memmove

Example
#include <string.h>
#include <stdio.h> /* for printf */

void tst_memset (void) {
  unsigned char buf [10];

  memset (buf, '\0', sizeof (buf));
  /* fill buffer with null characters */
}

Keil logo

Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.