On this page
  1. ctypes.byref
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

ctypes.byref

Prev: ctypes.BigEndianUnion | Up: ctypes | Next: ctypes.c_bool
Rel: ctypes.addressof, ctypes.alignment, ctypes.ArgumentError, ctypes.Array
Ref: docs.python.org — ctypes.byref
Tags: #public #python3 #stdlib #ctypes


Import

import ctypes
from ctypes import byref

Signature & Overview

ctypes.byref(obj, offset=0, /)

Return a pointer lookalike to a C instance, only usable as function argument.

Usage

import ctypes

x = ctypes.c_int(5)
ref = ctypes.byref(x)
assert ref is not None

Gotchas

REPL Inspect

from ctypes import byref
help(byref)

Linked from

Related notes