摘要: 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 阅读(26) 评论(0) 推荐(0)
摘要: stdio.h #include <stdio.h> FILE *fopen(const char *filename, const char *mode); int fclose(FILE *stream); int fflush(FILE *stream); size_t fread(void 阅读全文
posted @ 2024-07-12 16:34 EdisoNewton 阅读(44) 评论(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 阅读(38) 评论(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 阅读(17) 评论(0) 推荐(0)