• <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++/Linux/Embedded

            學習也是一種樂趣
            <2025年7月>
            293012345
            6789101112
            13141516171819
            20212223242526
            272829303112
            3456789

            統(tǒng)計

            • 隨筆 - 4
            • 文章 - 4
            • 評論 - 4
            • 引用 - 0

            常用鏈接

            留言簿(1)

            隨筆檔案

            文章分類

            文章檔案

            收藏夾

            搜索

            •  

            最新評論

            閱讀排行榜

            評論排行榜

            2007年5月8日

            遍歷刪除vector的中的元素

            一般來說vector不適合做經常刪除的容器,但是在某些情況下,我們確實需要刪除vector的部分元素,一般的方式類為v.erase(remove_if(v.begin(), v.end(), func)).但是本人懶的把操做寫到另一個函數(shù)中,下面是一個更好的辦法

            vector<int>::reverse_iterator rit = v.rbegin();
            while (rit != v.rbegin())
            {
                
            if (func(*rit)) //檢查是否需要刪除
                    v.erase((++rit).base());
                
            else
                   
            ++rit;
            }

            其中reverse_iterator和iterator的關系與轉換是關鍵,STL真是設計的強大.

            posted @ 2007-05-08 10:43 陳長虹 閱讀(5808) | 評論 (4)編輯 收藏

            2007年3月31日

            一個VIM的腳本

            使用VIM編寫程序,發(fā)現(xiàn)切換頭文件和代碼文件很麻煩,發(fā)現(xiàn)一個好東西A.vim,具體使用參數(shù)如下:
            A switches to the header file corresponding to the current file being edited (or vise versa)
            :AS splits and switches
            :AV vertical splits and switches
            :AT new tab and switches
            :AN cycles through matches
            :IH switches to file under cursor
            :IHS splits and switches
            :IHV vertical splits and switches
            :IHT new tab and switches
            :IHN cycles through matches
            <Leader>ih switches to file under cursor
            <Leader>is switches to the alternate file of file under cursor (e.g. on??<foo.h> switches to foo.cpp)
            <Leader>ihn cycles through matches
            下載地址如下:http://www.vim.org/scripts/script.php?script_id=31
            下載后放到/usr/share/vim/vim61/plugin/就可以了,如果啟動時候有錯誤,就下載一個老一點的版本.

            posted @ 2007-03-31 10:26 陳長虹 閱讀(434) | 評論 (0)編輯 收藏
            indent工具參數(shù)

            indent是一個常用的Linux的C代碼格式化工具,但是參數(shù)太多,很難記憶,目前發(fā)現(xiàn)一組參數(shù),可以格式化為我常用的代碼格式.

            -bad?-bap?-bbb?-bbo?-nbc?-bl?-bli0?-bls?-c33?-cd33?-ncdb?-ncdw?-nce?-cli0?-cp33?-cs?-d0?-nbfda??-nfc1?-nfca?-hnl?-ip5?-l75?-l
            p?
            -pcs?-nprs?-saf?-sai?-saw?-nsc?-nsob?-nss?-i4?-ts4?-ut
            保存在~/.indent.pro,就是默認的indent參數(shù)了.

            posted @ 2007-03-31 10:12 陳長虹 閱讀(1031) | 評論 (0)編輯 收藏

            2007年3月12日

            開張了

            從Google上發(fā)現(xiàn)了這個C++專門的Blog,發(fā)現(xiàn)很不錯,有自己寫的欲望了,申請了一下,今天開張,希望能記錄一些經驗,保存一些自己看到的比較好的文章.

            posted @ 2007-03-12 15:20 陳長虹 閱讀(915) | 評論 (0)編輯 收藏
            僅列出標題  
            热re99久久6国产精品免费| 久久er国产精品免费观看8| 中文国产成人精品久久不卡| 免费无码国产欧美久久18| 久久夜色精品国产亚洲| 97r久久精品国产99国产精| 99久久综合狠狠综合久久| 日本国产精品久久| 99久久国产热无码精品免费| 久久久久亚洲AV成人网人人网站| 午夜福利91久久福利| 2021少妇久久久久久久久久| 久久久久18| 99精品国产在热久久| 亚洲人成无码久久电影网站| 久久电影网2021| 亚洲色欲久久久综合网东京热| 国产ww久久久久久久久久| 久久综合亚洲鲁鲁五月天| 精品久久久久久国产牛牛app| 精品国产乱码久久久久久呢 | 热久久这里只有精品| 性欧美大战久久久久久久 | 久久精品无码专区免费| 久久AV高清无码| 亚洲AV日韩精品久久久久| 色综合久久久久综合99| 91久久九九无码成人网站| 久久久久亚洲av无码专区| 亚洲国产另类久久久精品小说| 久久夜色精品国产亚洲av| 久久精品国产第一区二区| 国产精品成人99久久久久 | 久久久青草青青国产亚洲免观| 成人国内精品久久久久影院VR| 色狠狠久久AV五月综合| 久久久久青草线蕉综合超碰| 久久久久久精品无码人妻| 久久亚洲AV无码精品色午夜| 亚洲色婷婷综合久久| 国产精品一久久香蕉国产线看观看|