• <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 冬瓜 閱讀(1626) 評論(0)  編輯 收藏 引用 所屬分類: 原創
            日本国产精品久久| 久久亚洲精品无码VA大香大香| 人妻无码αv中文字幕久久琪琪布| 亚洲午夜精品久久久久久浪潮 | 亚洲午夜久久久| 亚洲中文字幕久久精品无码喷水| 人妻精品久久无码区 | 理论片午午伦夜理片久久| 精品久久人人爽天天玩人人妻| 91精品国产高清91久久久久久| 久久国产精品一区| 久久99久久99小草精品免视看| 亚洲&#228;v永久无码精品天堂久久| 久久久SS麻豆欧美国产日韩| 国产精品内射久久久久欢欢| 久久久久亚洲av无码专区| 天天做夜夜做久久做狠狠| 色偷偷888欧美精品久久久| 久久精品国产清自在天天线| 久久久黄片| 国产精品美女久久久免费| 久久精品aⅴ无码中文字字幕不卡| 久久97久久97精品免视看| 2021久久国自产拍精品| 亚洲中文字幕无码久久2017| 久久久久久亚洲精品影院| 久久亚洲AV永久无码精品| 亚洲国产精久久久久久久| 99久久er这里只有精品18| 久久综合久久自在自线精品自| 色诱久久av| 思思久久好好热精品国产| 欧美成a人片免费看久久| 久久99久久无码毛片一区二区| 亚洲伊人久久大香线蕉苏妲己| 国产精品久久久久久影院| 大伊人青草狠狠久久| 国产成人精品久久免费动漫| 久久99久久99小草精品免视看| 精品蜜臀久久久久99网站| 精品少妇人妻av无码久久|