After reading this post on comp.lang.c++.moderated, I was completely surprised that it compiled and worked in both VS 2008 and G++ 4.4. The code:
#include <stdio.h>
int main()
{
int x = 10;
while( x --> 0 ) // x goes to 0
{
printf("%d ", x);
}
}
Where in the standard is this defined, and where did it come from?
I'd assume C, since it works in GCC as well, but I put C++ on there just in case C++ has more to mention on it. On a more subjective note, I've never heard of this before, had anybody else? Is it worth using?
Edit
Because people keep taking this the wrong way, yes, I knew the answer and merely thought it would be a fun question. :P Kirill was the first to call me out, after I left a few "egging on" comments.
You sillies.