I'm new to both C and Python, I'm trying to get the C function getText() into Python but all I'm getting are numbers
This is foo.c
#include <stdio.h>
const char * getText(void)
{
return "world hello";
}
const char * getText2(void)
{
return "hello world";
}
And this is my python code from the terminal
>>> import ctypes
>>> testlib = ctypes.CDLL('/home/user/dir/libfoo.so')
>>> testlib.getText()
743175865
I have already compiled the shared object and testing it with puts("Hello world") works as it appears in the terminal.
I'm sure I'm accessing the getText() wrongly from python but I don't know which one. Any suggestions or help would be appreciated