• <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>

            鍵盤上的舞者

            My Email: marckywu@gmail.com
            隨筆 - 19, 文章 - 0, 評論 - 3, 引用 - 0
            數(shù)據(jù)加載中……

            C/C++

            安全訪問數(shù)組的指針類模板
                 摘要: 在用數(shù)組作為數(shù)據(jù)結(jié)構(gòu)存儲數(shù)據(jù)的時候,一不小心就訪問越界了,這類錯誤有時候很不容易發(fā)現(xiàn)。為此自己封裝一個專門用來訪問數(shù)組元素的指針類模板。此類模板需要數(shù)組的元素類型,起始地址,大小來構(gòu)造一個安全的Ptr2T指針對象,此對象訪問數(shù)組的方法不但與普通的指針相同,同時還增加了越界的安全檢查。  閱讀全文

            posted @ 2009-08-13 18:29 Marcky 閱讀(368) | 評論 (0)  編輯

            顯示構(gòu)造函數(shù)與轉(zhuǎn)換運算符的合作
                 摘要: 在設(shè)計一個Date類的時候,我們使用int類型來表示年份,如果我們需要對年份進行一些特殊的操作(如:檢查,保護等),就很需要定義一個Year類,如下:  閱讀全文

            posted @ 2009-08-13 14:39 Marcky 閱讀(280) | 評論 (0)  編輯

            Allocating Arrays Using Placement new (zz)
                 摘要: An additional version of operator new enables you to construct an object or an array of objects at a predetermined memory position. This version is called placement new and has many useful applications, including building a custom-made memory pool or a garbage collector. Additionally, it can be used in mission-critical applications because there's no danger of allocation failure; the memory that's used by placement new has already been allocated. Placement new is also faster because the cons  閱讀全文

            posted @ 2009-08-13 00:48 Marcky 閱讀(365) | 評論 (0)  編輯

            復(fù)制構(gòu)造函數(shù)之淺復(fù)制與深復(fù)制
                 摘要: 復(fù)制構(gòu)造函數(shù)的函數(shù)名為類的名字,無返回值,和構(gòu)造函數(shù)的區(qū)別就在于形參的不同。復(fù)制構(gòu)造函數(shù)的形參為同類類型的引用,并且通常限定為const的引用,如Person類的復(fù)制構(gòu)造函數(shù)的聲明為:  閱讀全文

            posted @ 2009-07-13 01:56 Marcky 閱讀(532) | 評論 (0)  編輯

            構(gòu)造函數(shù)初始化列表
                 摘要: 我們定義一個如下的Person類:
            class Person {
            public:
            Person() { } //default constructor function
            Person(string name, string phone, string addr)  閱讀全文

            posted @ 2009-07-11 17:47 Marcky 閱讀(1195) | 評論 (0)  編輯

            const形參的函數(shù)重載
                 摘要: 《C++ primer》中提到“僅當(dāng)形參是引用或指針的時候,形參是否為const才對重載有影響。”  閱讀全文

            posted @ 2009-07-11 15:09 Marcky 閱讀(1221) | 評論 (3)  編輯

            關(guān)于多態(tài)的有趣理解
                 摘要: 在CSDN學(xué)生大本營看到如下有趣的理解多態(tài)...呵呵。。。  閱讀全文

            posted @ 2009-07-05 22:12 Marcky 閱讀(243) | 評論 (0)  編輯

            NULL, 0, \0 ,nul的區(qū)別(轉(zhuǎn)載)
                 摘要: NULL is a macro defined in several standard headers, 0 is an integer constant, '\0' is a character constant, and nul is the name of the character constant. All of these are not interchangeable:  閱讀全文

            posted @ 2009-07-01 23:10 Marcky 閱讀(338) | 評論 (0)  編輯

            超大整數(shù)的加法運算
                 摘要: 所謂超大數(shù)就是int, 甚至long int等數(shù)據(jù)類型無法直接對其存儲的整數(shù)。對于這種超大書的加法運算,我的解決方案是:
            首先將輸入的大數(shù)轉(zhuǎn)化為字符串存儲起來,這樣一來,字符串的首字符就對應(yīng)著大數(shù)的最高位,末字符就對應(yīng)大數(shù)的最低位。
            然后,從兩個字符串的末尾開始取出一個字符,將其轉(zhuǎn)化為一個一位整數(shù)后進行相加(這里相加的時候還需要加上進位標(biāo)志的值),這樣將產(chǎn)生兩種情況:  閱讀全文

            posted @ 2009-06-30 16:02 Marcky 閱讀(1012) | 評論 (0)  編輯

            狠狠狠色丁香婷婷综合久久俺| 久久九九免费高清视频| 亚洲国产精品久久久久网站| 久久综合久久自在自线精品自| 久久精品国产亚洲av高清漫画| 久久精品视频免费| 精品久久久久久国产三级| 精品国产乱码久久久久软件| 久久久av波多野一区二区| 久久精品国产亚洲沈樵| 热RE99久久精品国产66热| 成人免费网站久久久| 久久久久久久久波多野高潮| 久久亚洲精品视频| 久久久久亚洲av无码专区导航| 青青草原1769久久免费播放| 国产69精品久久久久APP下载| 久久精品国产亚洲av麻豆色欲| 青青草原综合久久大伊人导航| 亚洲精品无码久久久久去q| 亚洲欧美一级久久精品| 精品久久久久久无码中文字幕 | 亚洲午夜无码久久久久小说| 色婷婷久久综合中文久久蜜桃av| 丁香五月综合久久激情| 91性高湖久久久久| 亚洲欧美成人综合久久久 | 久久精品国产精品亚洲人人 | 无码任你躁久久久久久老妇App| 久久精品免费一区二区三区| 久久亚洲私人国产精品| 久久久久久久波多野结衣高潮| 久久99久久成人免费播放| 国产精品岛国久久久久| WWW婷婷AV久久久影片| 国内精品久久久久久99| 久久人人爽人人爽人人片av麻烦 | 久久久久一级精品亚洲国产成人综合AV区 | 久久国产亚洲精品无码| 久久久亚洲欧洲日产国码aⅴ| 久久精品国产久精国产果冻传媒|