### Method

# GLib Variant n_children

since: 2.24

#### Declaration

    gsize
    g_variant_n_children (
      GVariant* value
    )

#### Description

Determines the number of children in a container `GVariant` instance. This includes variants, maybes, arrays, tuples and dictionary entries. It is an error to call this function on any other type of `GVariant`.

For variants, the return value is always 1. For values with maybe types, it is always zero or one. For arrays, it is the length of the array. For tuples it is the number of tuple items (which depends only on the type). For dictionary entries, it is always 2

This function is O(1).

Available since: 2.24

#### Return value

Type: `gsize`

The number of children in the container.