operators - bitwise operator in c - What is the “-->” operator in C++?

c++ operators / c++ / c / code-formatting / standards-compliance

After reading Hidden Features and Dark Corners of C++/STL on comp.lang.c++.moderated, I was completely surprised that the following snippet compiled and worked in both Visual Studio 2008 and G++ 4.4.

Here's the code:

#include <stdio.h>
int main()
{
    int x = 10;
    while (x --> 0) // x goes to 0
    {
        printf("%d ", x);
    }
}
9 8 7 6 5 4 3 2 1 0

37 revs, 25 users 24%



Answer #1
while( x-- > 0 )