1

I have a dll and c code. c code includes many functions not in dll. and I have to make an interface(?) of these functions for python(2.7.x). but the C code uses pointer operation, and I don't know that in Python ctypes module.

see this(not exact code but similar):

void func(unsigned char *arr){
    if( *(arr-1) == *(arr+3) ) {/*...*/}
}

but in python ctypes module, I cannot run a code like this:

t = c_char_p
# .... do sth with variable t?
t -= 2;
print t.value

how can i make it run in python? does any way that i can cast a c_char_p type to integer type or function for modifying the address exist?

I tried c_char_p to c_long casting but it doesn't work...

Thanks in advance!

1

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.