Skip to content

Commit 01b50a6

Browse files
committed
luajit.cpp
1 parent 1757c30 commit 01b50a6

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

section4/luajit.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,24 @@ void case1()
6767

6868
cout << path << endl;
6969
cout << cpath << endl;
70+
}
71+
72+
void case2()
73+
{
74+
MyLuaState L;
75+
76+
int status;
77+
78+
status = luaL_dostring(L, R"(print('hello\n');)");
79+
status = luaL_dofile(L, "./embedded.lua");
7080

71-
auto status = luaL_dofile(L, "./embedded.lua");
7281
//L.dofile("./embedded.lua");
7382
}
7483

7584
int main()
7685
{
7786
case1();
87+
case2();
7888

7989
cout << "luajit demo" << endl;
8090
}

0 commit comments

Comments
 (0)