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

ctypes.sizeof

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


Import

import ctypes
from ctypes import sizeof

Signature & Overview

ctypes.sizeof(obj, /)

Return the size in bytes of a C instance.

Usage

import ctypes

assert ctypes.sizeof(ctypes.c_uint64) == 8
assert ctypes.sizeof(ctypes.c_uint8 * 10) == 10

Gotchas

REPL Inspect

from ctypes import sizeof
help(sizeof)

Linked from

Related notes