• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            專職C++

            不能停止的腳步

              C++博客 :: 首頁 :: 聯系 :: 聚合  :: 管理
              163 Posts :: 7 Stories :: 135 Comments :: 0 Trackbacks

            常用鏈接

            留言簿(28)

            我參與的團隊

            搜索

            •  

            最新評論

            閱讀排行榜

            評論排行榜

            最近在用lua寫游戲服務器邏輯。
            用lua寫服務器邏輯簡單好多!你懂的!

            第一個問題是lua調C的返回值的問題
            //測試返回table
            /**
                下面代碼相當lua如下:
                function return_table()
                    local t = {}
                    t.result = true
                    t.data = "hello"
                    return t
                end
             
            */

            int tableReturnTable(lua_State * L)
            {
                lua_newtable(L);
                
            int table_index = lua_gettop(L);

                lua_pushboolean(L, 
            true);
                lua_setfield(L, table_index, 
            "result");

                lua_pushstring(L, 
            "hello"5);
                lua_setfield(L, table_index, 
            "data");

                
            return 1;
            }
            第二問題多參數返回
            //測試多返回
            /**
             下面代碼相當lua如下:
             function mult_return()
              return "hello",100,true
             end
             */
            int mult_return(lua_Status * L)
            {
             lua_pushstring(L, "hello");
             lua_pushnumber(L,100);
             lua_pushboolean(L,true);
             return 3;
            }
            第三個問題,刪除表中的元素
            local t = {}
            t.hello = "hello“
            t[1] = 100
            刪除辦法如下:
            t.hello = nil
            t[1] = nil
            清空table
            table.foreach(t, function(k,v) t[k] = nil end)
            posted on 2012-07-23 18:30 冬瓜 閱讀(1622) 評論(0)  編輯 收藏 引用 所屬分類: 原創
            日韩美女18网站久久精品| 狠狠久久综合伊人不卡| 日产精品久久久久久久性色| 色狠狠久久AV五月综合| 亚洲国产精品久久66| 久久笫一福利免费导航| 久久精品无码一区二区无码 | 婷婷久久综合| 久久无码人妻一区二区三区| 国内精品久久久久久久影视麻豆| 久久亚洲精品无码VA大香大香| 99久久国产综合精品麻豆| 一级做a爰片久久毛片毛片| 久久久久久夜精品精品免费啦| 91精品国产综合久久香蕉| 欧美黑人激情性久久| 久久精品无码一区二区三区日韩| 久久精品蜜芽亚洲国产AV| 久久无码AV中文出轨人妻| 国产巨作麻豆欧美亚洲综合久久| 精品无码久久久久国产| 久久综合久久美利坚合众国| 久久精品成人一区二区三区| 99国产欧美精品久久久蜜芽| 亚洲色大成网站www久久九| 伊人久久大香线蕉AV一区二区| 国产精品激情综合久久| 久久久青草久久久青草| 99久久婷婷国产综合亚洲| 亚洲午夜久久久影院| 免费无码国产欧美久久18| 亚洲人成电影网站久久| 亚洲精品综合久久| 2021国内久久精品| 久久伊人精品一区二区三区| 无码乱码观看精品久久| 欧美精品九九99久久在观看| 精产国品久久一二三产区区别 | 久久A级毛片免费观看| 久久九九兔免费精品6| 精品人妻伦九区久久AAA片69|