14
I am attempting to cast a C style const char[] string pointer (returned from a DLL) into a Python compatible string type. but when Python27 executes:
import ctypes
charPtr = ctypes.cast( "HiThere", ctypes.c_char_p )
print( "charPtr = ", charPtr )
we get: charPtr = c_char_p('HiThere')
perhaps something is not to be evaluating properly. My questions are:
- how should one cast this charPtr back into a Python compatible, print-able string?
- is the cast operation just mentioned doing what it should be doing?