C-language operator precedence

Source: Internet
Author: User
Tags bitwise

First level (4, from left to right): [] array subscript, () parentheses,. Member selection (object), member selection (pointer)

Second level (9, right-to-left union):-Minus sign operator, (type) coercion type conversion, + + increment operator 、--decrement operator, * accessor operator, & take address operator,! Logical non-operator, ~ bitwise negation operator.

Level Three (3, from left to right):/Except, * Multiply,% take modulo

Level fourth (2, combined from left to right): + Plus,-minus

Fifth level (2, combined from left to right):<< left shift,>> right shift

Sixth level (4, from left to right):> greater than, >= greater than or equal to,< less than, <= less than or equal to

Level seventh (2, from left to right): = = equals,! = is not equal to

Level eighth (one, from left to right):& bitwise AND

Level Nineth (one, left to right combination): ^ Bitwise XOR

Level tenth (one, from left to right): | Bitwise OR

Level 11th (one, from left to right):&& logic and

Level 12th (one, from left to right): | | Logical OR

Level 13th (one, from left to right):?: conditional operator

14th level (12, from left to right): = assignment operator,/= after assignment, *= multiply,%= modulus assignment, + = plus assignment,-= minus assignment, <<= left shift assignment, >>= right Shift assignment, &= bitwise and post assignment, ^= bitwise XOR or post-assignment, |= bitwise OR post-assignment, |= bitwise OR post-assigned value

Level 15th (one, left to right):, comma operator

C-language operator precedence

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.