[Solved] How will C parse this sentence? [closed]


It is parsed as:

b = (a++)++ + a;

This is an invalid expression. The increment operator can’t be applied twice as (a++) isn’t an lvalue.

The tokenizer isn’t context-aware and will match the longest token possible, so it is not parsed as the syntactically valid a++ + ++a. (That still would be invalid code, though, since it modifies a twice without a sequence point which invokes undefined behavior.)

7

solved How will C parse this sentence? [closed]