I am trying to get a string from lua into a char in c++. But for some reason it returns either a pointer or a number. I can use all the help I get on this one. Here is a example of what i'm trying to do:
Lua file:
logo = "ad.png"
C file:
lua_State *L = luaL_newstate();
luaL_openlibs(L);
luaL_dofile(L,"fuel.lua");
const char* logoX;
lua_getglobal(L, "logo");
if(lua_isnil(L,-1)){
printf("is nil!\n");
}
else{
logoX = lua_tostring(L, -1);
printf("the logo is %d\n", *logoX);
}
But this is printing out text that says "the logo is 105". Any help is appreciated. Thank you!
%din yourprintf, shouldn't that be%s?