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

ctypes.addressof

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


Import

import ctypes
from ctypes import addressof

Signature & Overview

ctypes.addressof(obj, /)

Return the address of the C instance internal buffer

Usage

import ctypes

x = ctypes.c_int(42)
addr = ctypes.addressof(x)
assert isinstance(addr, int) and addr > 0

Gotchas

REPL Inspect

from ctypes import addressof
help(addressof)

Linked from

Related notes