随笔分类 -  Lua

摘要:Lua中的可变长函数的参数用 ... 来表示 ( 3个 . ) 在函数内部有一个特殊的内置变量 arg 其格式如下 arg = { 1, "Hello", true, n = 3 } 1 -- function makeVarStr(...) to see print_Table.lua 2 3 f 阅读全文
posted @ 2024-07-12 18:14 EdisoNewton 阅读(6) 评论(0) 推荐(0) 编辑
摘要:-- start.lua a = 1 if a==1 -- missed KeyWord then print("in if") else print("in else") end -- main.lua chunk,errMsg = loadfile("start.lua") if not err 阅读全文
posted @ 2024-07-12 16:09 EdisoNewton 阅读(21) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <string> using namespace std; extern "C" { #include "lua.h" #include "lualib.h" #include "lauxlib.h" } int myTest(lua_Sta 阅读全文
posted @ 2024-07-12 15:04 EdisoNewton 阅读(7) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示