Matlab, Rust.
do_something_to_string_ffi function resultPtr = calllib(libName, 'do_something_to_string_ffi', str); result = resultPtr.Value{1}; calllib(libName, 'free_string_pointer', resultPtr); % Unload the library unloadlibrary(libName); end We call the function and receive a pointer. We can extract the value