【发布时间】:2021-05-02 00:14:44
【问题描述】:
有没有办法让我稍后在 Cython 中将指针移动到 n 个字节?
例如,如果我有(伪代码):
cdef void *n_ary
cdef void *eightbytes
cdef void *n_ary_plus8
ary = cnp.PyArray_DATA(input_array)
eightbytes = 8
n_ary_plus8 = ary + eightbytes
我收到错误 Invalid operand types for '+' (void *; void *) 最后一行告诉我它不知道如何添加指针地址 ary 和指针八字节。看起来这应该很明显,但我在手册或这个八月的参考资料中找不到任何内容。
【问题讨论】: