05-c language Operators

Source: Internet
Author: User
Tags arithmetic operators logical operators

Learning Focus:

    • Arithmetic operators
    • An arithmetic expression

Learning content:

The C-language operators can be divided into the following categories:

1. Arithmetic operators: Used for various numerical operations. Including plus (+), minus (-), multiply (*), except (/), balance (or modulo operation,%), self-increment (+ +), self-reduction (--) a total of seven.
2. Relational operators: Used for comparison operations. Includes more than (>), less than (<), equals (= =), greater than or equal (>=), less than Equals (<=), and not equal to (! =) Six.
3. Logical operators: for logical operations. Included with (&&), or (| |), non-(!) Three kinds.
4. Bitwise operator: The amount of the involved operation, calculated according to bits. There are six kinds of bits and (&), bit or (|), bit non (~), bit xor (^), left (<<), right Shift (>>).
5. Assignment operator: For assignment operation, divided into simple assignment (=), compound arithmetic Assignment (+=,-=,*=,/=,%=) and compound bit operation Assignment (&=,|=,^=,>>=,<<=) Three class total 11 kinds.
6. Conditional operator: This is a three-mesh operator for conditional evaluation (?:).
7. Comma operator: Used to combine several expressions into an expression (,).
8. Pointer operator: used to fetch content (*) and Fetch address (&) Two kinds of operations.
9. The number of bytes operator: the number of bytes (sizeof) used to calculate the data type.
10. Special operators: Parentheses (), subscript [], member (→,.) and several others.

Precedence and binding issues for operators

The precedence is higher than the low priority of the operation, C language precedence and binding is the same as in mathematics, but the assignment needs to be noted, such as "X=y=z", the assignment operator is the right combination, first execute "y=z", and then Execute "x= (y=z)".

05-c language Operators

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.