反编译工具之后是这样的:
知乎的解答如下(https://www.zhihu.com/question/52311366)
下面是在vs2013中编译的结果:
while (true) 编译前
while (true);
编译后
mov eax,1
test eax,eax
je wmain+29h
jmp wmain+1Eh
for ( ; ; )编译前
for (;;);
编译后
jmp wmain+29h
很显然,for ( ; ; )指令少,不占用寄存器,而且没有判断、跳转,比while (true)好。