Quote:
Originally Posted by Digilogic
The expression I am dealing with is
a += ---b--;
That is just a small portion of the statement but my job is to add parenthesis to enforce the implicit c precedence rules.
I haven't been able to come up with a way to make this work.
I keep getting the compile error invalid lvalue in decrement when I try things such as:
a = -(--(b--));
a = -((--b)--);
etc...
Any ideas why this won't run?
|
i believe its because the addition of the parenthesies are forcing it to parse in an order it doesn't like. why can't you just change the code to look and work simply instead of being complex? KISS.
a += -(b-2);
a += (-(b-1))-1;