lua basic usage

#pragma comment (lib, "lua5.1.lib")

#include <conio.h>

extern "C"{
#include "lua.h"
#include "lualib.h"
#include "lauxlib.h"
}

int main()
{
    // Create and start our environment
    lua_State *EnvOne = lua_open();

    // Load libs
    luaL_openlibs(EnvOne);

    // Run our "test.lua" file
    luaL_dofile(EnvOne, "test.lua");

    // Close our environment
    lua_close(EnvOne);

    // Get a character
    getchar();

    return 0;
}

原文地址:https://www.cnblogs.com/otfsenter/p/8467289.html

时间: 2024-10-10 21:17:47

lua basic usage的相关文章

github basic usage

1. create a new accout, create orginazation, create repo 2. install git in your local pc Note: you can create ssh key to avoid username/password input for github operation https://help.github.com/articles/generating-ssh-keys https://help.github.com/a

something about basic usage of vector,queue

1.for a two dimension vector, we must assign at least the first dimension of the vector 2.each dimension of an inner vector can be different 3.if you don't want to set a volume for vector<vector<int> > for uncertainness, you can just use a met

STATES TUTORIAL, PART 1 - BASIC USAGE(第二部分)

STATES TUTORIAL, PART 1 - BASIC USAGE(第二部分) SETTING UP THE SALT STATE TREE在master设置file_roots 示例: 1 file_roots: 2 base: 3 - /srv/salt 重启master pkill salt-master salt-master -d PREPARING THE TOP FILE 配置top入口文件 1 base: 2 '*': 3 - webserver 说明:top文件可以起到

pcl之basic usage

pcl之basic usage width(int) two meanings: it can specify the total number of points in the cloud for unorganized point cloud datasets; it can specify the width (total number of points in a row) of an organized point cloud dataset. The advantages of an

3.0 Basic Usage of Class

Well, this week I tried to use some class things. Following are parts of my exercising codes. Definig my class named Time //note that cnt is a static member of this class to count the number of //instances created. Constructors & Overloading //as you

Basic Tutorials of Redis(6) - List

Redis's List is different from C#'s List,but similar with C#'s LinkedList.Sometimes I confuse with them.I expect that you won't mix them and have a clear mind of them. There are 17 commands we can use in List. Push and pop are the base opreation of t

YTKNetwork Basic Guide YTKNetwork基本指导 及用法

YTKNetwork Basic Guide  :YTKNetwork基本指导 In the article, we will introduce the basic usage of YTKNetwork.  在这篇文章中,我们将介绍YTKNetwork的基本用法. YTKNetwork's basic composition   YTKNetwork的基本组成 YTKNetwork mainly contains the following classes:  YTKNetwork主要包含以

Lua的各种资源1

Libraries And Bindings     LuaDirectory > LuaAddons > LibrariesAndBindings This is a list of libraries implemented in Lua or implemented in another language (e.g. C) but having a Lua interface. For older libraries and bindings, see the LuaAddonsArch

Love2D游戏编程-3(回调函数 Callback Functions)

(本文使用Windows平台) 1.回调函数列表 在main.lua里我们要处理游戏逻辑,主要依靠回调函数,它们会被love自动调用. love.draw Callback function used to draw on the screen every frame. love.focus Callback function triggered when window receives or loses focus. love.joystickpressed Called when a joy