I have a c function that I want to return a string.
If I print the string before it is returned then I see croc_data_0186.idx
If I try and print the string
The problem is that you are returning an stack variable, lost when function returns. One way to make this is to use a char * arg in function parameter, with enough reserved space, and use it to store all information and returns it.