摘要:
如何传递一个数组给动态库中的函数,并通过传递的数组返回字符串呢?这里演示一种间接的方法。不知道有没有更直接的方法?1 动态库中的函数定义:struct ss { char name[10]; int age; };void GetString(struct ss *p){ strcpy(p->name, "Hello dll."); p->age = 25;}编译生成dll.so: gcc -fPIC -O2 -shared dll.c -o dll.so2 python中调用实例:from ctypes import *class ss(Structure): 阅读全文
posted @ 2012-03-14 15:46
windflying
阅读(7034)
评论(0)
推荐(0)

浙公网安备 33010602011771号