通常,我会使用
lua_pushstring(lua_State* L, const char* s);
Run Code Online (Sandbox Code Playgroud)
但是,我要推送的字符串可能包含空字符.我该如何工作?
Amb*_*ber 12
void lua_pushlstring (lua_State *L, const char *s, size_t len);
Run Code Online (Sandbox Code Playgroud)
将带有size len的s指向的字符串压入堆栈.Lua生成(或重用)给定字符串的内部副本,因此可以在函数返回后立即释放或重用s中的内存.该字符串可以包含嵌入的零.
| 归档时间: |
|
| 查看次数: |
2097 次 |
| 最近记录: |