有以下假设代码:
cdef extern from "string.h":
int strcmp(char* str1, char* str2)
def foo(list_str1, list_str2):
cdef unsigned int i, j
c_arr1 = ??
c_arr2 = ??
for i in xrange(len(list_str1)):
for j in xrange(len(list_str2)):
if not strcmp(c_arr1[i], c_arr2[j]):
do some funny stuff
Run Code Online (Sandbox Code Playgroud)
有没有办法将列表转换为c数组?
我已经阅读并尝试过Cython - 将字符串列表转换为char**,但这只会引发错误.