---
name: "qb_array_index"
section: "3"
platform: "linux"
package: "libqb"
version: "2.0.10-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/qb_array_index"
---

# qb\_array\_index(3)

Get an element at a particular index.

## NAME

qb\_array\_index - Get an element at a particular index.

## SYNOPSIS

```
#include <qb/qbarray.h>

int32_t qb_array_index(
    qb_array_t   *a,            /* array instance */
    /*
     * the index, valid in [0, QB_ARRAY_MAX_ELEMENTS) range
     */
    int32_t       idx,
    void        **element_out   /* the pointer to the element data */
);
```

## PARAMS

**a**           *array instance*

**idx**         *the index, valid in \[0,* **QB\_ARRAY\_MAX\_ELEMENTS***) range*

**element\_out** *the pointer to the element data*

## DESCRIPTION

## RETURN VALUE

**(0 == success, else -errno)**

## SEE ALSO

[*qb\_array\_elems\_per\_bin\_get*(3)](/qb_array_elems_per_bin_get/3.md), [*qb\_array\_new\_bin\_cb\_set*(3)](/qb_array_new_bin_cb_set/3.md), [*qb\_array\_create*(3)](/qb_array_create/3.md), [*qb\_array\_grow*(3)](/qb_array_grow/3.md), [*qb\_array\_num\_bins\_get*(3)](/qb_array_num_bins_get/3.md), [*qb\_array\_create\_2*(3)](/qb_array_create_2/3.md), [*qb\_array\_free*(3)](/qb_array_free/3.md)

## COPYRIGHT

Copyright (C) 2010-2020 Red Hat, Inc.
