I have a big problem....can't solve it. I have free pascal program and lua script.
function getString(i:integer):PChar;public; stdcall;
begin
//something to do
Result:=strnew(PChar('newString'));
end
by passing the registration functions there is Lua implementation
ffi.cdef
[[
char*__stdcall getString(i:integer);
]]
local str =ffi.C.getString(5)
print (tostring(str))
instead of 'newString' I get address of cdata. Please anybody help me to understand this moment. How to solve it?