• <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)  編輯 收藏 引用 所屬分類: 原創
            www.久久热.com| 婷婷久久五月天| 久久婷婷综合中文字幕| 国产成人精品久久亚洲高清不卡| a级成人毛片久久| 色婷婷狠狠久久综合五月| 五月丁香综合激情六月久久| 久久久久久久综合日本亚洲 | 久久亚洲中文字幕精品有坂深雪| 久久亚洲精品成人AV| 成人a毛片久久免费播放| 狠狠色丁香婷婷久久综合| 精品久久久久久中文字幕| 久久精品99无色码中文字幕| 精品久久久久久中文字幕大豆网| 久久99精品久久久久久| 久久久噜噜噜久久中文字幕色伊伊 | 久久精品国产亚洲精品| 久久不见久久见免费视频7| 久久免费大片| 免费观看久久精彩视频| 久久亚洲私人国产精品| 精品久久久久久久久免费影院| 国产激情久久久久影院| 久久er热视频在这里精品| 久久婷婷五月综合色奶水99啪| 99久久精品无码一区二区毛片 | 久久精品亚洲男人的天堂 | 久久精品成人欧美大片| 成人资源影音先锋久久资源网| 久久精品亚洲AV久久久无码| 亚洲欧美国产精品专区久久| 久久男人AV资源网站| 国产一区二区精品久久岳| 9191精品国产免费久久| 国产一级持黄大片99久久| 97久久精品午夜一区二区| 久久精品99久久香蕉国产色戒| 久久久久久毛片免费播放| 久久大香香蕉国产| 亚洲国产精品久久久久婷婷软件|