standards-compliance - operators in c++ pdf - What is the “-->” operator in C++?

relational operators in c++ / c++ / c / operators / code-formatting

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
int x = 10;

while( 0 <---- x )
{
   printf("%d ", x);
}

You can control speed with an arrow!

int x = 100;

while( 0 <-------------------- x )
{
   printf("%d ", x);
}