usually i would just use
lua_pushstring(lua_State* L, const char* s);
however, the line I want to click may have a null character. How to do it?
Use lua_pushlstring .
lua_pushlstring
void lua_pushlstring (lua_State *L, const char *s, size_t len);
Pushes the line pointed to by s, with the size len on the stack. Lua makes (or reuses) an internal copy of the given string, so the memory in s can be freed or reused right after the function returns. A string may contain embedded zeros.
Source: https://habr.com/ru/post/1309277/More articles:What should I learn to improve my Java skills? - javaSegmentation Fault in a sieve with prime numbers - c ++how to restore postgresql database without backup - postgresqlStrange bubble sorting behavior - cDetermining the best table structure for MySQL performance - performancePHP: enabled function against calling a static function. Better than the other? - phpProblems with the Rails Rails model - ruby-on-railsCreate and use an instance of a class whose class name is known only at run time - reflectionHow to get today the day of the previous month in ruby? - ruby | fooobar.comIs it possible to connect and send a message via a GSM modem using asp.net? - c #All Articles