python cffi 调用c语言传入数组
文章目录代码Python代码c语言代码运行结果
代码
Python代码
from cffi import FFI
ffi = FFI()
ffi.cdef("""
void calculate(unsigned long *par);
""")
# verify是在线api模式的基本方法它里面直接写C代码即可
lib = ffi.verify(sources=['test.c'])
x = ffi.new("unsigned long[10]") # allocate one int,
原创
2020-09-23 15:05:11 ·
294 阅读 ·
0 评论