int main ()
{
int a = 5,b = 2;
printf("%d",a+++++b);
return 0;
}
error: lvalue required as increment operand
The code above cannot be executed, but if you write a++++b
together, it will be executed, right?
What's the difference?
int main ()
{
int a = 5,b = 2;
printf("%d",a++ + ++b);
return 0;
}
printf("%d",a++++b);
is treated as (a++++b
because of the Maximum Munch Rule.
You can only get lvalue as an operand for the posterior increment
The result of the first (a++)
is not lvalue
An error occurs in (a++)++
.
© 2024 OneMinuteCode. All rights reserved.