#include <stdio>
int main(){
int x = 4;
int y = 3;
int z;
z = x---y;
printf("%d" , z);
return 0;
}
The gcc compiler in Linux Mandriva evaluates it as (x--)-y.
I am confused as to why is it so.
It could have been x - (--y).
I know some of the answers would tell me to look at precedence tables. Ihave gone through all of them, still the doubt persists.
Please anybody clarify this.
The rule is “when getting the next token, use the longest sequence of characters possible that constitute a valid token”. So
---is--followed by a-and not the other way around. Precedence has actually nothing to do with this.