Home > Article > Backend Development > In C/C++, what is the meaning of operator c=a+++b?
Let us consider that in C or C, there is a similar statement:
c = a+++b;
So what is the meaning of this line of code?
Okay, let a and b be 2 and 5 respectively. This expression can be viewed as two different types.
has post-increment operator and pre-increment operator. How they are used depends on how they are used.
There are two basic concepts. Priority and associativity. Now if we check the expression from left to right, the result will be these two.
Now let’s check Which option was selected by the compiler -
#include <iostream> using namespace std; main() { int a = 2, b = 5; int c; c = a+++b; cout << "C is : " << c; }
C is : 7
Here the first option is selected.
The above is the detailed content of In C/C++, what is the meaning of operator c=a+++b?. For more information, please follow other related articles on the PHP Chinese website!