码迷,mamicode.com
首页 > 其他好文 > 详细

hello lua

时间:2014-11-20 01:25:24      阅读:191      评论:0      收藏:0      [点我收藏+]

标签:style   blog   io   ar   color   os   sp   div   log   

 1 #include <stdio.h>
 2 #include <stdlib.h>
 3 #include <string.h>
 4 #include "lua.h"
 5 #include "lualib.h"
 6 #include "lauxlib.h"
 7 
 8 int main(int argc, char** argv)
 9 {
10     char line[1024] = {0};
11     lua_State* L = luaL_newstate();
12     luaL_openlibs(L);
13 
14     while (fgets(line, sizeof(line), stdin)!=0)
15     {
16         luaL_dostring(L, line);
17     }
18 
19     lua_close(L);
20     
21     return 0;
22 }

 

hello lua

标签:style   blog   io   ar   color   os   sp   div   log   

原文地址:http://www.cnblogs.com/hangj/p/4109540.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!