from ctypes import *

TenIntArrayType = c_int * 10 #相当于定义了一个int[10]类型
arr = TenIntArrayType()
#访问方法
for ii in arr:
print (ii)

#或者
for ii in range(10):
print (arr[ii])

lib = cdll.LoadLibrary("dll.so")
#取指针
lib.PrintData(pointer(arr), 10)

ctypes基本数据类型:定义了对应于C内置类型的相应类型
http://docs.python.org/release/2.5/lib/module-ctypes.html
...

相关文章:

  • 2022-12-23
  • 2021-04-09
  • 2022-12-23
  • 2021-09-28
  • 2022-12-23
  • 2021-05-28
  • 2021-06-17
  • 2021-07-20
猜你喜欢
  • 2021-07-28
  • 2022-12-23
  • 2021-12-24
  • 2021-11-18
  • 2021-05-01
  • 2021-12-27
相关资源
相似解决方案