---
name: "ck_bitmap_init"
section: "3"
platform: "linux"
package: "libck-dev"
version: "0.7.2-6"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/ck_bitmap_init"
---

# ck\_bitmap\_init(3)

initialize a bitmap

## NAME

**ck\_bitmap\_init** – initialize a bitmap

## LIBRARY

Concurrency Kit (libck, -lck)

## SYNOPSIS

**#include \<ck\_bitmap.h\>**

*void*\

**ck\_bitmap\_init**(*ck\_bitmap\_t \*bitmap*, *unsigned int n\_bits*, *bool set*);

## DESCRIPTION

The **ck\_bitmap\_init**() function initializes the bitmap pointed to by the *bitmap* pointer. The argument *n\_bits* specifies the number of bits that are to be stored in the bitmap. The argument *set* determines whether the values of the bits in *bitmap* are to be initialized to 1 or 0.

It is expected that *bitmap* points to a contiguous region of memory containing at least the number of bytes specified by [ck\_bitmap\_size(3)](/ck_bitmap_size/3.md).

## RETURN VALUES

This function has no return value.

## ERRORS

The behavior of **ck\_bitmap\_init**() is undefined if *bitmap* is not a pointer to a region of bytes of at least [ck\_bitmap\_size(3)](/ck_bitmap_size/3.md) length.

## SEE ALSO

[ck\_bitmap\_base(3)](/ck_bitmap_base/3.md), [ck\_bitmap\_size(3)](/ck_bitmap_size/3.md), [ck\_bitmap\_set(3)](/ck_bitmap_set/3.md), [ck\_bitmap\_reset(3)](/ck_bitmap_reset/3.md), [ck\_bitmap\_clear(3)](/ck_bitmap_clear/3.md), [ck\_bitmap\_test(3)](/ck_bitmap_test/3.md), [ck\_bitmap\_bits(3)](/ck_bitmap_bits/3.md), [ck\_bitmap\_buffer(3)](/ck_bitmap_buffer/3.md)

Additional information available at http://concurrencykit.org/
