interpy-zh icon indicating copy to clipboard operation
interpy-zh copied to clipboard

使用C扩展部分 Python/C API 有问题

Open ThomasXu18 opened this issue 6 years ago • 0 comments

int n;
char *s;
PyObject* list;
PyArg_ParseTuple(args, "siO", &n, &s, &list);

PyArg_ParseTuple(args, "siO", &n, &s, &list);&n&s 的顺序写反了。 应为

int n;
char *s;
PyObject* list;
PyArg_ParseTuple(args, "siO", &s, &n, &list);

ThomasXu18 avatar Feb 18 '19 12:02 ThomasXu18