pass by reference - Cython error: Cannot convert Python object to type 'int *' error, when passing an Integer array to a function -


i trying pass integer array function in cython , cannot understand why error mentioned in title.

a sample code of trying following:

cpdef foo(int *table): in range(10):     table[i] =  cdef int *temp=<int *>malloc(10*sizeof(int)) foo(temp)  in range(10):     print temp[i] 

i appreciate pointers how pass array correctly function. thank you.

the issue here function cpdef - means can called both c , python code, , means arguments must python objects (otherwise how 1 call python?)

declare cdef instead.


Comments

Popular posts from this blog

ios - iPhone/iPad different view orientations in different views , and apple approval process -

java Extracting Zip file -

C# WinForm - loading screen -