Re: C Programming Problem
Tested using Dev c++, but the error continues.
a+++++b;
This line is parsed by the compiler the following way.
1.Operand 'a' is added to the stack.
2.The next operand encountered is '++' .It checks to if there is an lvalue to operate upon.In this case the lvalue is 'a',so no problem and it is added to the stack.
3.The next operand encountered is also '++'. The compiler analyses a statement sequentially, not entirely and so there is no question of analysing the rest of the statement to interpret the operators as '+' and then '++'.Since the operator is a ++ it checks to see if there is an lvalue to operate upon. There's none and hence the error.
Remember 'a+++b' is processed as a++ + b.
If you write a++ + ++b, there is no invalid increment operator.