C-language operator precedence

Source: Internet
Author: User

The precedence of C-language operators is cured by C grammar, and the precedence of operators is naturally obtained by grammatical interdependencies.

Therefore, familiarity with C-grammar, to understand the C operator precedence, is more advanced than the rote priority table, and can answer beginner's doubts: Why is the priority order? More importantly, it is possible to know how the C-language "compound" expression is combined with operations.

In addition, only Ricky's C language book mentions C grammar, the other C language books are not mentioned, come up is "must" "should" remember the hard instructions! In fact, familiar with the C grammar, these priority problems are no longer a problem!

According to the expression of C99, in order to facilitate understanding, organized into the following production conversion diagram, which contains the operator priority at a glance!





Image view big picture way: Way 1: Right-click Save! Way 2: Open the image in the new tab (Chrome has this feature)!

Note: The only difference between C99 and C89 in the expression grammar is that there are two new production (type-name) {initialized columns} in C99 's Postfix exp generation, and the rest of the operators are no different from the original design of Ricky!

C-language operator precedence

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.