---
title: Dynamic-typing system (latest version)
description: API reference for Dynamic-typing system in the latest version of qiskit-c
source: https://quantum.cloud.ibm.com/docs/en/api/qiskit-c/dynamic-types
---

# Dynamic-typing system

Several places in Qiskit allow the runtime definition of additional types and behavior. These use a consistent set of dynamic-typing methods and helpers to declare and interact with such objects.

### QkVtableEntry

`struct QkVtableEntry`

An entry in a vtable for defining objects with custom behavior.

This same structure is used in several places when defining “custom behavior” for objects dynamically at runtime of your C program. The valid values of `slot`, `flag` and the function-pointer type of `ptr` will vary based on the context you are passing it to.

Typically, you will defining program statics of tables of these, terminating in the sentinel value `{-1, 0, NULL}`. Various Qiskit C API functions will take arguments of this form, and return a “vtable” handle back, which can then be used to define “instances” of the object with this attached behavior.

#### uint32\_t slot

The “slot” of the function, or the sentinel `(uint32_t)-1` to mark the final array entry.

This is typically set to some `enum` value, where the particular `enum` varies depending on which vtable you are defining.

#### uint32\_t flags

Any additional “flags” for the particular table entry. These will typically be or’d (`|`) together, and the valid set of flags will be documented by the table user.

#### void \*ptr

A function pointer implementing the correct signature for the combination of the `slot` and `flags`.

This can be `NULL` only in the case of `slots` being the sentinel `-1`.
