Keil 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 */
}
  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.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.