ctypes function returns const char pointer

This is the place for queries that don't fit in any of the other categories.

ctypes function returns const char pointer

Postby kirbyfan64sos » Thu Sep 12, 2013 12:27 am

A have a C function that returns a const char pointer. I'm trying to figure out how to access the result using ctypes. I'm doing this:

Code: Select all
address = mydll.myfunc()
path = (ctypes.c_char).from_address(address)

I only get the first character of the result, however. How would I go about this?
This program is bug-free. If you see a bug, it's actually a feature.
Posts: 7
Joined: Sun Aug 25, 2013 10:45 pm

Return to General Coding Help

Who is online

Users browsing this forum: Google [Bot] and 5 guests