### Function

# GLib PtrArray insert

since: 2.40

#### Declaration

    void
    g_ptr_array_insert (
      GPtrArray* array,
      gint index_,
      gpointer data
    )

#### Description

Inserts an element into the pointer array at the given index. The array will grow in size automatically if necessary.

Available since: 2.40

This function is not directly available to language bindings.

#### Parameters

`array`

  Type: An array of `gpointer`

  A `GPtrArray`.

  The data is owned by the caller of the function.

`index_`

  Type: `gint`

  The index to place the new element at, or -1 to append.

`data`

  Type: `gpointer`

  The pointer to add.

  The argument can be `NULL`.
  The data is owned by the caller of the function.