What is the "-->" operator in C/C++? What is the "-->" operator in C/C++? c c

What is the "-->" operator in C/C++?


--> is not an operator. It is in fact two separate operators, -- and >.

The conditional's code decrements x, while returning x's original (not decremented) value, and then compares the original value with 0 using the > operator.

To better understand, the statement could be written as follows:

while( (x--) > 0 )


Or for something completely different... x slides to 0.

while (x --\            \             \              \               > 0)     printf("%d ", x);

Not so mathematical, but... every picture paints a thousand words...


That's a very complicated operator, so even ISO/IEC JTC1 (Joint Technical Committee 1) placed its description in two different parts of the C++ Standard.

Joking aside, they are two different operators: -- and > described respectively in §5.2.6/2 and §5.9 of the C++03 Standard.