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

            BillyYu

            The means of Gotcha

            From Wikipedia, the free encyclopedia

            Gotcha is a Slang term derived from the phrase "I got you", usually referring to an unexpected capture or discovery. It may refer to an unexpected or unintuitive, but documented, behavior in a computer system( as opposed to a bug). It may also refer to many other things, they are omitted in this paper.
            A gotcha is a detrimental condition (usually of a contract or agreement) that is designed to sneak past the other party. For example, many "free" Credit Report sites have "gotchas" that automatically sign you up for a monthly credit report service unless you explicitly cancel. "Gotcha" is also a frequently used programming term.
            Programming gotchas

            In programming, a gotcha is a feature of a system, a program or a programming language that works in the way it is documented but is counter-intuitive and almost invites mistakes because it is both enticingly easy to invoke and completely unexpected and/or unreasonable in its outcome.


            Gotchas in the C programing language

            Equality operator

            The classic gotcha in C is the fact that

            if (a=b) code;


            is syntactically valid and sometimes even correct. It puts the value of b into a and then executes code if a is non-zero. What the programmer probably meant was

            if (a==b) code;


            which executes code if a and b are equal.

            Function calls

            In C and C++, function calls that need no arguments still require parentheses. If these are omitted the program will still compile, but will not produce the expected results. For example:

            #include <iostream>
            using namespace std;
            int myfunc(){
            return 
            42;
            }
            int main (){
            cout 
            << myfunc;
            return 
            0;
            }


            The program will only display the expected result (the string 42) if the form cout << myfunc(); is used. If the shown form cout << myfunc; is used, the address of the function myfunc is cast to a boolean value, and the program will instead display the string 1.

            Gotchas in the C++ programing language

            Initializer lists

            In C++, it is the order of the class inheritance and of the member variables that determine the initialization order, not the order of an initializer list:

            #include <iostream>
            class CSomeClass
            {
            public:
            CSomeClass(
            int n)
            {
            std::cout 
            << "CSomeClass constructor with value ";
            std::cout 
            << n << std::endl;
            }
            };
            class CSomeOtherClass
            {
            public:
            CSomeOtherClass() 
            //In this example, despite the list order,
            : obj2(
            2), obj1(1//obj1 will be initialized before obj2.
            {
            //Do nothing.
            }
            private:
            CSomeClass obj1;
            CSomeClass obj2;
            };
            int main(void)
            {
            CSomeOtherClass obj;
            return 
            0;
            }

            posted on 2007-09-15 22:50 志華 閱讀(1002) 評論(4)  編輯 收藏 引用

            評論

            # re: The means of Gotcha 2007-09-15 23:09 Minidx全文檢索

            下面是一點參考:
            如果你打球時假動作逼真,騙過了對手,球回到令對手意想不到的地方而得分,就可以自鳴得意的大叫一聲 “Gotcha!”,意思是(I’ve)got you,騙到你了吧!不知大家記不記得電影《小鬼當家》,小機靈用玩具水槍嚇得歹徒落荒而逃后,滿臉童真的笑意,說了一句“Gotcha!”

            如果你開玩笑,朋友卻信以為真,也可以說Gotcha,騙到你了吧。

            在電腦領域中尤其是編程語言里經常出現,到底是什么意思呢?

            Gotcha是I’ve got you的省略語,為“難倒你了”、“問倒你了”的意思。

            I got you.
            我了解.

            這句跟 I see, I understand, 都是一樣的, 適合在跟美國同學討論功課時使用. 例如有一次我跟我的美國同學說這題該怎么怎么作, 他就很高興地說, Ok, now I got you. 你如果不說 I got you, 說 I got it 也是可以的, 這二個都很常聽人家說.
             
            另外 I got you 有一個更常用的解釋, 就是我騙到你了, 通常會讀成 Gotcha.. 比如說你騙人家說, I got married. 別人回答: Oh~ Really? 這時你就可以吹著口哨說.. Hahaha.. Gotcha.

            C+ +長久演化與發展以來,這樣一本gotchas書籍的遲遲出版顯得有點怪怪的。C++作為一個現實可用的語言,已經有至少十五年的歷史了;而C++標準在過去的五年中也幾乎沒有改變。就此你可能會認為,語言中的缺陷現在應該已經成為眾人皆知的“常識(common knowledge)[注1]”了。然而,即使經驗豐富的C++程序員也會時不時遇到麻煩;Steve Dewhurst——這位從業多年的C++課程教師、作者以及顧問——則比任何人都清楚這一點。Dewhurst看上去似乎更多的是在責備程序員的求次而安,而非C++的復雜性。在本書中,對C++基礎議題的忽視及不良的風格被列為程序設計中的兩大原罪。經驗本身無法避免這樣一些人為的失誤;有時候我們確是需要一些刺耳忠言。據此,C++ Gotchas不僅僅是一本關于C++疑難雜癥的目類書籍,也是現世警言,提醒我們去關注那些可能被我們忽視的問題。

            慣用法便是上述問題之一。在口語中,所謂慣用法是指被經常使用的單語(比如“gotcha”),其能迅捷的表達一個明晰的含義。而慣用法的含義之所以明晰,則僅僅是因為該單語被廣泛使用,而非其中的各單字的含義使然。在一門編程語言中,一個慣用法是指一個表達式或技巧,其能夠明晰的表達程序員的意圖。同樣,編程語言中慣用法表意明晰之性質源自其被廣泛使用的程度。一個沒能學到口語慣用法的人會處于非常不便的境地;而一個不使用編程慣用法的程序員則會導致其他所有程序員——特別是其代碼維護者——的工作更難做。在Dewhurst的書中,恰當的運用慣用法被視為良好的編程風格,而良好的編程風格可以最大程度的減少gotchas出現。  回復  更多評論   

            # re: The means of Gotcha 2007-09-16 07:49 志華

            原來有了這樣一本書出來了啊,有機會的話,倒可以好好的研究研究?。≈x謝Minidx,發現你的blog上好多東西,要好好的學習下
            ^_^@Minidx全文檢索
              回復  更多評論   

            # re: The means of Gotcha 2007-09-17 00:07 turing

            gotcha一般可以譯為“陷阱”。  回復  更多評論   

            # re: The means of Gotcha 2007-09-17 15:57 力為

            I got you~  回復  更多評論   

            <2007年9月>
            2627282930311
            2345678
            9101112131415
            16171819202122
            23242526272829
            30123456

            導航

            統計

            常用鏈接

            留言簿(1)

            隨筆分類

            隨筆檔案

            文章檔案

            搜索

            最新評論

            閱讀排行榜

            評論排行榜

            青青青青久久精品国产h久久精品五福影院1421| 一级做a爱片久久毛片| 午夜精品久久久久久久无码| 亚洲午夜无码久久久久小说| 亚洲女久久久噜噜噜熟女| 精品熟女少妇a∨免费久久| 久久精品成人免费网站| 久久久久久亚洲精品影院| 麻豆AV一区二区三区久久| 伊人久久大香线蕉精品| 久久久久久精品久久久久| 久久婷婷综合中文字幕| 99久久香蕉国产线看观香| 91久久福利国产成人精品| 国产精品99久久久精品无码| 国产成人精品久久一区二区三区av| 国产精品久久久久蜜芽| 狠狠久久综合伊人不卡| 久久久久AV综合网成人 | 久久免费美女视频| 欧美亚洲国产精品久久| 99久久国产主播综合精品| 无码人妻少妇久久中文字幕蜜桃| 久久国产成人午夜aⅴ影院 | 国产成人久久777777| 亚洲av日韩精品久久久久久a | 久久久青草青青国产亚洲免观| 狠狠色婷婷久久综合频道日韩| 久久av高潮av无码av喷吹| 久久婷婷国产麻豆91天堂| 91精品国产91久久久久福利| 久久亚洲AV成人无码电影| 久久狠狠爱亚洲综合影院| 中文精品99久久国产| 欧美亚洲日本久久精品| 久久综合伊人77777| 久久久久人妻一区精品 | 国产69精品久久久久9999| 精品久久久久久久久中文字幕| 99久久99久久久精品齐齐| 国产V亚洲V天堂无码久久久|