我构造了一个 numpy 数组::
a=np.ndarray([2,3])
然后我想看看它的数据在哪里::
a.data
>>>Out[213]: <read-write buffer for 0x0482C1D0, size 48, offset 0 at 0x049E87A0>
a.data
>>>Out[214]: <read-write buffer for 0x0482C1D0, size 48, offset 0 at 0x049E82A0>
a.data
>>>Out[215]: <read-write buffer for 0x0482C1D0, size 48, offset 0 at 0x049E81C0>
...
为什么每次偏移地址都不一样?如果我想通过以下方式使用 c_types 将数据传输到 ac 函数:
ctypes_array = (ctypes.c_char * a.size * 8).from_address(ptr)
我应该如何获得 ptr 的值?