C ++ expressions and statements

Source: Internet
Author: User

Operator priority

The operators in each interval have the same priority, and the operators in the preceding interval have a higher priority.

 

The unary operator and the value assignment operator combine the right operator, while other operators combine the left operator. For example, a = B = C means a = (B = C), A + B + C is (a + B) + C

 

Overflow, overflow, and division by zero will not throw a standard exception

 

In an expression, the order in which subexpressions are evaluated is not defined. You cannot evaluate an expression from left to right. For example:

Int X = F (2) + G (3); // no definition of F () or G () which calls first

Int I = 1;

V [I] = I ++; // The result is not defined.

 

Void CPY (char * P, char * q)

{

While (* P ++ = * q ++ );

}

 

The delete operator can only use the pointer or 0 returned by new, and will not affect the 0 application.

 

Pointer conversion cannot be expressed directly in the T (e) notation. For example, char * (2) is a syntax error.

 

Int J = int (); // default int Value

Complex z = complex (); // default Complex Value

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.