---
name: "ck_bitmap_next"
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_next"
---

# ck\_bitmap\_next(3)

iterate to the next set bit in bitmap

## NAME

**ck\_bitmap\_next** – iterate to the next set bit in bitmap

## LIBRARY

Concurrency Kit (libck, -lck)

## SYNOPSIS

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

*bool*\

**ck\_bitmap\_next**(*ck\_bitmap\_t \*bitmap*, *ck\_bitmap\_iterator\_t iterator*, *unsigned int \*bit*);

## DESCRIPTION

The **ck\_bitmap\_next**() function will increment the iterator object pointed to by *iterator* to point to the next set bit in the bitmap. If **ck\_bitmap\_next**() returns true then the pointer pointed to by *bit* is initialized to the number of the current set bit pointed to by the *iterator* object.

It is expected that *iterator* has been initialized using the [ck\_bitmap\_iterator\_init(3)](/ck_bitmap_iterator_init/3.md) function.

## RETURN VALUES

If **ck\_bitmap\_next**() returns true then the object pointed to by *bit* contains a set bit. If **ck\_bitmap\_next**() returns false then value of the object pointed to by *bit* is undefined.

## ERRORS

Behavior is undefined if *iterator* or *bitmap* are uninitialized.

## SEE ALSO

[ck\_bitmap\_base(3)](/ck_bitmap_base/3.md), [ck\_bitmap\_size(3)](/ck_bitmap_size/3.md), [ck\_bitmap\_init(3)](/ck_bitmap_init/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\_bits(3)](/ck_bitmap_bits/3.md), [ck\_bitmap\_buffer(3)](/ck_bitmap_buffer/3.md), [ck\_bitmap\_iterator\_init(3)](/ck_bitmap_iterator_init/3.md)

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