You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The third entry would also have to be a statement to support that, correct?
No, in C-family languages, assignment is an operator. It has two operands (left and right, like + or any other operator) and it returns a value (the value that was assigned), and just has the side effect of changing the left operand. This is why you can do a = b = c;. Since the grouping for binary operators of same priority is right-to-left, that is equivalent to b = c; a = b;
Anything with an operator is an expression. Statements are a superset of that that also allow things like variable declarations.
Currently, the for loop syntax is
, but it should be
Specifically, this should be possible
for (int i = 0; i < N; i++) {...}
The scope of the first statement is the scope of the entire block. In other words, the above is equivalent to
The text was updated successfully, but these errors were encountered: