0

If I write a code like(in c)

    x=1;
    z=2;
    y=x---z;

will first two - be treated as post-decrement and later one as subtraction

or first - will be treated as subtraction and other two as pre-decrement

and what if I put a space to make it the other (because in c program doesn't change by white space)

Dhruva Mehrotra
  • 123
  • 1
  • 12
  • Also more specific duplicate [here](http://stackoverflow.com/questions/13874179/can-you-have-a-triple-minus-signs-in-c-programming-what-does-it-mean). โ€“ Lundin Nov 03 '15 at 10:26

1 Answers1

6

As per the C11 standard, chapter ยง6.4 , lexical elements, (emphasis mine)

If the input stream has been parsed into preprocessing tokens up to a given character, the next preprocessing token is the longest sequence of characters that could constitute a preprocessing token. [..]

So,

y=x---z;

is

y= (x--) - z;

This is also called as Maximal munch rule.

Sourav Ghosh
  • 133,132
  • 16
  • 183
  • 261