C-language operator precedence and formulas

Source: Internet
Author: User
Tags logical operators

A total of 15 priority levels:

1 () []. -

2! ~-(minus) + +--& (take variable address) * (type) (mandatory type) sizeof

3 */%

4 +-

5 >> <<

6 > >= < <=

7 = = =!

8 &

9 ^

10 |

&&

12 | |

13?:

+ = = *=/=%= |= ^= &= >>= <<=

15,

It's just a lot of it. Binding: 2 13 14 is from right to left the other is left to right


Bracket member first;  The parentheses operator [] () member operator. -

The whole monocular second; All monocular operators such as + +,--、 + (positive),-(negative), pointer operations *, &

Multiplication Yozo, plus minus four; This "remainder" refers to the residual operation that is%

Shift five, relationship six; Shift operators:<< >>, Relationships:> < >= <=, etc.

Equal to (and) unequal row seventh; that is = = and! =

Bits and Xor and bits or; These are bitwise operations: Bits and (&) XOR (^) bits or (|)

"Three points of the world" eighty or ninety;

logic or heel; Logical operators: | | and &&

12 and 11;  Note Order: Priority (| |) Bottom-to-priority (&&)

Conditions above assignment,//three mesh operator precedence to 13-bit only than assignment operator and "," high

Lowest comma operation level! The comma operator has the lowest precedence

C-language operator precedence and formulas (RPM)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.