Original Post
I have a function that is implemented in C++ like this (Not actual implementation. Just an example of what I'm tying to do.)
const char* getName()
{
return obj->getName().c_str(); // g_obj->getName returns std::string
}It is called from C so I cant return std::string. How can I return a C string without memory problems?