【发布时间】:2011-10-28 10:08:30
【问题描述】:
我有一个简单的 C 函数。
类型定义结构{ long unsigned int 第一; long unsigned int 秒; 诠释 c; } 片段; 构造{ long unsigned int 四; 片段片段[10000]; }; 结构测试(){ struct out *out = (struct out *)malloc(sizeof(struct out)); ... 返回 *out }如何在 Python 中使用这个函数?任何将此结构转换为 python 对象的示例(使用 python 包装器)?
【问题讨论】:
-
为什么要从 C 函数返回
int?这里正确的返回类型是out*。