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

            隨感而發(fā)

            雜七雜八

            統(tǒng)計(jì)

            留言簿(13)

            閱讀排行榜

            評(píng)論排行榜

            [轉(zhuǎn)]C++操作符號(hào)的優(yōu)先級(jí)


            原文地址:http://www.cppreference.com/wiki/operator_precedence
            哈哈。以后不用到處去看書啦。謝謝那個(gè)哥們。
            Operator Description Example Overloadable
            Group 1 (no associativity)
            :: Scope resolution operator Class::age = 2; NO
            Group 2
            () Function call isdigit('1') YES
            () Member initalization c_tor(int x, int y) : _x(x), _y(y*10){}; YES
            [] Array access array[4] = 2; YES
            -> Member access from a pointer ptr->age = 34; YES
            . Member access from an object obj.age = 34; NO
            ++ Post-increment for( int i = 0; i < 10; i++ ) cout << i; YES
            -- Post-decrement for( int i = 10; i > 0; i-- ) cout << i; YES
            const_cast Special cast const_cast<type_to>(type_from); NO
            dynamic_cast Special cast dynamic_cast<type_to>(type_from); NO
            static_cast Special cast static_cast<type_to>(type_from); NO
            reinterpret_cast Special cast reinterpret_cast<type_to>(type_from); NO
            typeid Runtime type information cout « typeid(var).name();
            cout « typeid(type).name();
            NO
            Group 3 (right-to-left associativity)
            ! Logical negation if( !done ) … YES
            not Alternate spelling for !
            ~ Bitwise complement flags = ~flags; YES
            compl Alternate spelling for ~
            ++ Pre-increment for( i = 0; i < 10; ++i ) cout << i; YES
            -- Pre-decrement for( i = 10; i > 0; --i ) cout << i; YES
            - Unary minus int i = -1; YES
            + Unary plus int i = +1; YES
            * Dereference int data = *intPtr; YES
            & Address of int *intPtr = &data; YES
            new Dynamic memory allocation long *pVar = new long;
            MyClass *ptr = new MyClass(args);
            YES
            new [] Dynamic memory allocation of array long *array = new long[n]; YES
            delete Deallocating the memory delete pVar; YES
            delete [] Deallocating the memory of array delete [] array; YES
            (type) Cast to a given type int i = (int) floatNum; YES
            sizeof Return size of an object or type int size = sizeof floatNum;
            int size = sizeof(float);
            NO
            Group 4
            ->* Member pointer selector ptr->*var = 24; YES
            .* Member object selector obj.*var = 24; NO
            Group 5
            * Multiplication int i = 2 * 4; YES
            / Division float f = 10.0 / 3.0; YES
            % Modulus int rem = 4 % 3; YES
            Group 6
            + Addition int i = 2 + 3; YES
            - Subtraction int i = 5 - 1; YES
            Group 7
            << Bitwise shift left int flags = 33 << 1; YES
            >> Bitwise shift right int flags = 33 >> 1; YES
            Group 8
            < Comparison less-than if( i < 42 ) … YES
            <= Comparison less-than-or-equal-to if( i <= 42 ) ... YES
            > Comparison greater-than if( i > 42 ) … YES
            >= Comparison greater-than-or-equal-to if( i >= 42 ) ... YES
            Group 9
            == Comparison equal-to if( i == 42 ) ... YES
            eq Alternate spelling for ==
            != Comparison not-equal-to if( i != 42 ) … YES
            not_eq Alternate spelling for !=
            Group 10
            & Bitwise AND flags = flags & 42; YES
            bitand Alternate spelling for &
            Group 11
            ^ Bitwise exclusive OR (XOR) flags = flags ^ 42; YES
            xor Alternate spelling for ^
            Group 12
            | Bitwise inclusive (normal) OR flags = flags | 42; YES
            bitor Alternate spelling for |
            Group 13
            && Logical AND if( conditionA && conditionB ) … YES
            and Alternate spelling for &&
            Group 14
            || Logical OR if( conditionA || conditionB ) ... YES
            or Alternate spelling for ||
            Group 15 (right-to-left associativity)
            ? : Ternary conditional (if-then-else) int i = (a > b) ? a : b; NO
            Group 16 (right-to-left associativity)
            = Assignment operator int a = b; YES
            += Increment and assign a += 3; YES
            -= Decrement and assign b -= 4; YES
            *= Multiply and assign a *= 5; YES
            /= Divide and assign a /= 2; YES
            %= Modulo and assign a %= 3; YES
            &= Bitwise AND and assign flags &= new_flags; YES
            and_eq Alternate spelling for &=
            ^= Bitwise exclusive or (XOR) and assign flags ^= new_flags; YES
            xor_eq Alternate spelling for ^=
            |= Bitwise normal OR and assign flags |= new_flags; YES
            or_eq Alternate spelling for |=
            <<= Bitwise shift left and assign flags <<= 2; YES
            >>= Bitwise shift right and assign flags >>= 2; YES
            Group 17
            throw throw exception throw EClass(“Message”); NO
            Group 18
            , Sequential evaluation operator for( i = 0, j = 0; i < 10; i++, j++ ) … YES

            哎,效果沒(méi)有那里好??磥?lái)操作還需要練習(xí)。呵呵

            posted on 2009-04-01 13:44 shongbee2 閱讀(1003) 評(píng)論(0)  編輯 收藏 引用 所屬分類: c/c++

            99热热久久这里只有精品68| 99热成人精品免费久久| 亚洲欧美精品一区久久中文字幕| 久久99精品久久久久久齐齐| 国产精品欧美亚洲韩国日本久久 | 99久久777色| 国产成人AV综合久久| 久久中文字幕精品| 97久久香蕉国产线看观看| 久久精品国产国产精品四凭| 国产毛片欧美毛片久久久| 精品久久久久久无码中文字幕| 精品伊人久久久| 国产精品激情综合久久| 久久夜色精品国产噜噜亚洲AV| 久久婷婷综合中文字幕| 亚洲午夜久久久影院| 香港aa三级久久三级老师2021国产三级精品三级在 | 久久精品国产99久久久香蕉| 狠狠综合久久综合88亚洲| 狠狠精品久久久无码中文字幕| 久久婷婷五月综合97色一本一本| 久久久久女教师免费一区| 久久精品国产69国产精品亚洲 | 久久国产亚洲精品无码| 一级a性色生活片久久无少妇一级婬片免费放 | 久久精品中文字幕一区| 欧美亚洲另类久久综合婷婷 | 久久人人爽人人爽人人片AV麻豆| 欧美黑人激情性久久| 久久只有这精品99| 色婷婷狠狠久久综合五月| 久久精品国产一区二区| 久久久WWW免费人成精品| 日本精品久久久久中文字幕8| 99久久婷婷免费国产综合精品| 久久香蕉国产线看观看精品yw| 久久久久99精品成人片试看| 亚洲精品美女久久久久99| 亚洲国产精品无码久久SM | 亚洲国产成人精品女人久久久|