I am new to python ctypes, What is the difference between POINTER()
and pointer()
, and what are their functions?
POINTER()
creates a type. pointer()
creates an instance.
For example, in C:
typedef int* PINT;
Would be:
import ctypes
PINT = ctypes.POINTER(ctypes.c_int)
Whereas:
int value = 5;
int* p = &value;
Would be:
import ctypes
value = ctypes.c_int(5)
p = ctypes.pointer(value)