
lua_pushstring(lua_State* L,const char* s);
但是,我要推送的字符串可能包含空字符.我该如何工作?
解决方法 使用lua_pushlstring. voID lua_pushlstring (lua_State *L,const char *s,size_t len);
总结Pushes the string pointed to by s with size len onto the stack. Lua makes (or reuses) an internal copy of the given string,so the memory at s can be freed or reused immediately after the function returns. The string can contain embedded zeros.
以上是内存溢出为你收集整理的lua c api:如何在中间推送一个带空字符的字符串?全部内容,希望文章能够帮你解决lua c api:如何在中间推送一个带空字符的字符串?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)