在阅读了comp.lang.c++.moderated
上的Hidden Features and Dark Corners of C++/STL后,我完全惊讶地发现以下代码片段在Visual Studio2008和G++ 4.4中都可以编译和工作。
代码如下:
#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
我假设这是C,因为它在GCC中也可以工作。这是在标准中定义的,它来自哪里?
https://stackoverflow.com/questions/1642028
复制相似问题