Let's work from the outside, in:
if (...) continue;
This is an if-statement
, with a single statement (continue
) as its body.
The continue
statement is only valid within a loop. So, somewhere there is a loop - either for
or do ... while
or while
- and this statement is inside it.
If the condition is true, whatever that is, the continue
will cause the execution of body of the loop to skip forward to the end of the loop body, evaluate the condition of the loop, and possibly increment and start the next iteration (depending on the loop guard, and whether there's a for
loop with a non-empty increment).
Now let's look at the inside:
(int_1 += *pointer++ = int_2++) < int_3
This is a parenthesized expression being compared with int_3
. So we have something like:
temp < int_3
This is a conditional expression, being used inside an if
statement, so you can figure out how that's going to work.
The parenthesized expression looks like this:
int_1 += *pointer++ = int_2++
There are two binary operators in use. The ternary (three arguments) and binary (two arguments) have lower precedence than the unary (one argument) operators. So the =
and +=
will be evaluated "last"-ish. In fact, the assignment operators are right-associative
This means that in a scenario like this one, given A = B = C
(where =
can also be +=
, or %=
or whatever), the expression will be arranged as if it were:
A = (B = C)
Grouping to the right, instead of to the left as with +
and *
, where A+B+C becomes (A+B)+C.
So your inner expression is going to be separated into two parts:
int_1 += ( *pointer++ = int_2++ )
Now the right-hand part will be evaluated first:
*pointer++ = int_2++
There is a pointer-dereference (*
) operator, and two post-increment operators.
The post-increment operator evaluates to the current value of whatever you are applying it to, but then causes that value to be increment after evaluation. So int_2++
is really something like this:
(temp = int_2, int_2 = int_2+1, temp)
Likewise, saying *pointer++ = value
really means this:
*pointer = value
pointer = pointer + 1
So you have the target of the present value of the pointer being assigned to the present value of int_2
, and then both of them are incremented afterwards.
C defines its assignment operator to return the rvalue of the assignment. That is, to return the value that was stored into whatever lvalue is on the left side of the assignment operator. In this case, the =
assignment will return the present value (before post-increment) of int_2
.
So you have the final part of your expression:
int_1 += ...
Knowing that the value on the right (the rvalue) is going to be the present value of int_2
, your code is adding that value to int_1
. C's +=
operator is a shorthand: L += R
is the same as L = L + R
except it only evaluates L one time. So the end result is that something like int_1 = int_1 + int_2
gets executed.
You will recall that assignment operators return their assigned value. The same is true for special assignment operators. In this case, the result of the +=
will be the left side of the A < B
comparison that makes up your if
statement.
If we knew what int_1
and int_2
were, we could decide if that was going to be < int_3
, if we knew what int_3
was. ;-)