⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 testluacpp.cpp

📁 lua cpp 能和c++很好结合的一种脚本语言 体积小速度快
💻 CPP
字号:
/**    To build:          g++ -o testLuacpp testLuacpp.cpp ../src/Interpreter.cpp \     -I ~/downloads/lua51/include -DHAVE_LUA51 -I ../src \     -L ~/downloads/lua51/bin/Win32 -llua51*/#include <iostream>using namespace std;#include "Interpreter.hpp"int main(){    lua::Interpreter lua;    lua.doString("a=1; b=2; c=3; a,b,c = c,b,a");    try    {        lua.doFile("dontexist.lua");        assert( ! "file exists" );    }    catch (const std::exception& exc)    {        cout << exc.what() << ": " << lua.errMsg() << endl;    }        lua.doFile("test.lua");    lua.doString("print(a,b,c)");}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -