Want to know pre increment and post increment operator in c? we have a huge selection of pre increment and post increment operator in c information on alibabacloud.com
Prefix and suffix of the auto-increment and auto-increment operators, and suffix of the operator prefix.
There is such a question in the exam:
12
inta = 4;(++a) += i;
Evaluate the value of a. The correct answer is 10.
If you think
Absrtact: In C language teaching, the self-increment self-subtraction operator is widely used, and it has certain skill and difficulty. Among the many operators, the self-increment decrement operator is the most difficult to understand and the most
1. Since the pre-increment and post-increment operators are unary operators, the overloads are distinguished by adding an int parameter (dummy parameter) to the post-increment, and when the post-increment is called, the compiler automatically
In the previous chapters we have been exposed to the overload of the increment operator, at that time we did not distinguish between the previous increment and the ++a difference, under normal circumstances we are not separate from the a++, but it
Transferred from: http://bbs.csdn.net/topics/330189207C language's self-increment + +, self-subtraction-operator has always been a problem for beginners, and even a lot of veteran will be confused, recently I saw a problem on the Internet:#include
1. Increment decrement operatorThe C + + language does not require that the increment decrement operator be a member of a class. But because they change exactly the state of the object being manipulated. Therefore, it is recommended to set the
Next, let's take a look at the example of the c ++ overload post-auto-addition operator. If you need to learn the C ++ auto-addition operator, you can refer to it.
The Code is as follows:
Copy code
# Include Using namespace
The code is as follows:Copy code # Include Using namespace std;Class num{Public:Int x;Num () {n = 1; cout Num (int I) {n = I; cout Num (const num & s) {this-> n = s. n; cout ~ Num () {cout Int get () const {return n ;}Void set (int x) {n = x
the Java operators include the following: arithmetic operators, comparison operators, bitwise operators, logical operators, assignment operators, and other operators. (The figure is from the network)simple operators, it is not too much to introduce
+ + increments each have pre-increment and post-increment differences, while overloaded operators, although the function names are the same, there should be a corresponding difference. The result of the increment operator before an integer variable
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.