---
name: "bzero"
section: "3"
platform: "linux"
package: "man-pages"
version: "6.19-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux", "freebsd", "macos"]
url: "https://new.carta.tech/bzero"
---

# bzero(3)

byte-array zero

## NAME

bzero - byte-array zero

## LIBRARY

Standard C library (*libc*, *-lc*)

## SYNOPSIS

```
#include <strings.h>  // see memory.h(3head)
```

**void bzero(**size\_t n;            **void** *a***\[***n***\], size\_t** *n***);**

## DESCRIPTION

This function writes zeros ('\\0') to the memory starting at the location pointed to by *a*.

It is equivalent to

```
memset(a, '\0', n)
```

## RETURN VALUE

None.

## ATTRIBUTES

For an explanation of the terms used in this section, see [**attributes**(7)](/attributes/7.md).

| | | |
| --- | --- | --- |
| **Interface** | **Attribute** | **Value** |
| **bzero**() | Thread safety | MT-Safe |

## STANDARDS

None.

## HISTORY

4\.3BSD.

Marked as LEGACY in POSIX.1-2001. Removed in POSIX.1-2008.

## CAVEATS

If the compiler deduces that the operation is unnecessary, it may totally or partially remove the call. To ensure the zeroing happens regardless of optimizations, use [**explicit\_bzero**(3)](/explicit_bzero/3.md).

## SEE ALSO

[**bstring**(3)](/bstring/3.md), [**memory.h**(3head)](/memory.h/3head.md), **explicit\_zero**(3), [**memset**(3)](/memset/3.md)
