---
name: "memset"
section: "3"
platform: "macos"
package: "Libc"
version: "1752.120.2"
release: "macOS 26.5"
platforms: ["linux", "freebsd", "macos"]
url: "https://new.carta.tech/memset"
---

# memset(3)

fill a byte string with a byte value

## NAME

**memset** – fill a byte string with a byte value

## LIBRARY

Standard C Library (libc, -lc)

## SYNOPSIS

**#include \<string.h\>**

*void* *\**\

**memset**(*void \*b*, *int c*, *size\_t len*);

## DESCRIPTION

The **memset**() function writes *len* bytes of value *c* (converted to an *unsigned char*) to the string *b*.

## RETURN VALUES

The **memset**() function returns its first argument.

## SEE ALSO

[bzero(3)](/bzero/3.md), [memset\_pattern(3)](/memset_pattern/3.md), memset\_s.3, [swab(3)](/swab/3.md), [wmemset(3)](/wmemset/3.md)

## STANDARDS

The **memset**() function conforms to ISO/IEC 9899:1990 (“ISO C90”).
