ctypes pointers

Giorgos Giagas giorgosg at gmail.com
Wed Nov 14 06:47:50 EST 2007


Hi all,
I have started using ctypes and I am having some questions I can't
seem to find the answers to.

There is a structure referenced by a pointer in an other structure and
I want to see if it is one of the structures I have pointers to.
So what I think I need is a way to compare 2 pointer's memory
location. I can't find a way to do this. Pointer comparisons don't
work. Is there something else I should do?

The other thing is more of a curiosity... The documentation says that
I need to keep references to structures so they don't get freed is
this also true for structures returned as pointers? What about
structures that I cast to something else? I guess the largest of the
two casts gets freed like it should... can someone confirm this?




More information about the Python-list mailing list