On this page
ctypes.c_int
Prev: ctypes.c_float_complex | Up: ctypes | Next: ctypes.c_int16
Rel: ctypes.addressof, ctypes.alignment, ctypes.ArgumentError, ctypes.Array
Ref: docs.python.org — ctypes.c_int
Tags: #public #python3 #stdlib #ctypes
Import
import ctypes
from ctypes import c_int
Signature & Overview
ctypes.c_int(...)
ctypes.c_int class.
Usage
import ctypes
n = ctypes.c_int(-42)
assert n.value == -42
Gotchas
- Platform C
int(typically 32-bit signed): Usec_int32/c_int64when exact bit width matters.
REPL Inspect
from ctypes import c_int
help(c_int)
Linked from
Related notes
- tuts/python3/stdlib_module/ctypes/c_float_complex Linked here; links to this page; shared tags: #ctypes, #stdlib
- tuts/python3/stdlib_module/ctypes/c_int16 Linked here; links to this page; shared tags: #ctypes, #stdlib
- tuts/python3/stdlib_module/ctypes Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/ctypes/addressof Linked here; shared tags: #ctypes, #stdlib
- tuts/python3/stdlib_module/ctypes/alignment Linked here; shared tags: #ctypes, #stdlib
- tuts/python3/stdlib_module/ctypes/ArgumentError Linked here; shared tags: #ctypes, #stdlib
- tuts/python3/stdlib_module/ctypes/Array Linked here; shared tags: #ctypes, #stdlib
- tuts/python3/stdlib_module/ctypes/BigEndianStructure shared tags: #ctypes, #stdlib
- tuts/python3/stdlib_module/ctypes/BigEndianUnion shared tags: #ctypes, #stdlib
- tuts/python3/stdlib_module/ctypes/byref shared tags: #ctypes, #stdlib