• <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)  編輯 收藏 引用 所屬分類: 原創
            日本五月天婷久久网站| 中文字幕精品久久久久人妻| 久久93精品国产91久久综合| 香蕉久久夜色精品国产小说| 久久国产亚洲精品麻豆| 久久精品国产一区二区电影| 日产精品久久久久久久性色| 伊人久久综合热线大杳蕉下载| 国产精品亚洲美女久久久| 国产午夜福利精品久久2021| 久久无码精品一区二区三区| 亚洲精品无码久久久久去q | 波多野结衣久久| 久久久久久夜精品精品免费啦| 人人狠狠综合久久亚洲| 精品久久久久久中文字幕| 久久丝袜精品中文字幕| 狠狠色丁香婷婷久久综合不卡| 亚洲欧美另类日本久久国产真实乱对白| 亚洲va国产va天堂va久久| 国产—久久香蕉国产线看观看| 久久丫精品国产亚洲av不卡| 亚洲精品tv久久久久| 成人精品一区二区久久久| 婷婷伊人久久大香线蕉AV| 亚洲精品第一综合99久久| 亚洲国产精品无码久久青草 | 麻豆一区二区99久久久久| 人妻少妇精品久久| 精品久久久久久无码国产| 中文字幕成人精品久久不卡| 国产精品久久久久久久久| 久久夜色tv网站| 国产精久久一区二区三区| 久久99久久99精品免视看动漫| 久久天天躁夜夜躁狠狠 | 久久天天躁狠狠躁夜夜躁2O2O| 91麻豆国产精品91久久久| 久久久久久久综合狠狠综合| 久久强奷乱码老熟女| 日韩美女18网站久久精品|