C language Arithmetic Operators and arithmetic expressions

Source: Internet
Author: User

1. Introduction to operators
<1> Arithmetic Operators: +,-, *,/, % (remainder or modulo operation), ++, and -- seven Arithmetic Operators
<2> Relational operators: >,<, ==, >=, <=, and ,! = Six Relational operators
<3> logical operators: &, |, and ,! Three Types
<4> bitwise operation OPERATOR: the amount involved in the operation. bitwise AND (&), bitwise OR (|), bitwise non (~) , Bitwise exclusive or (^), left shift (<), right shift (>)
<5> value assignment operator: =, compound arithmetic value assignment (+ =,-=, * =,/=, % =), and compound bitwise operation value assignment (& = ,...) 11 types in three categories
<6> conditional operators: Three-object operators (? :)
<7> comma OPERATOR: Used to combine several expressions into one expression (,)
<8> pointer OPERATOR: used for content (*) and address (&) Operations
<9> Number of nodes OPERATOR: used to calculate the number of bytes occupied by the Data Type (sizeof)
<10> Special operators: (), subscripts [], members (->,.), and so on
2,
<1> operator priority: the operator priority is divided into 15 levels. Highest Level 1, lowest level 15
<2> operator combination:
A: From left to right
B: from right to left
<3> forced type conversion OPERATOR: (type specifier) (expression)
<4> auto-increment and auto-subtraction Operators
A: ++ I auto-increment 1 before other operations
B: -- I minus 1 before other operations
After c: I ++ I is involved in the operation, the value of I increases by 1.
D: After I -- I is involved in the operation, the value of I is reduced by 1.
3. Basic Type Classification features
Character char 1 (byte) c character set (value range)
Basic integer int 2-32768 ~ 32767
Short integer short int 2...
Long Integer long int 4-214783648 ~ 214783647
Unsigned 2 0 ~ 65535
Unsigned long 4 0 ~ 4294967295
Single precision float 4 3/4E-38 ~ 3/4E + 38
Double 8 1/7E-308 ~ 1/7 e + 308
4. Constant suffix
L or l long integer
Unsigned number of u or u
F or f floating point type
5. Constant type
Integer, long integer, unsigned number, floating point number, character, String, symbol constant, Escape Character

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.