各位大佬,新手小白,请教一下,具体输出细节麻烦告知一下
#include...int fun(){
static int x = 1;
x *= 2;
return x;
}
main()
{
int i,s = 1;
for(i=1;i<=3;i++)
s *= fun();
printf("%d\n",s);
}
我认为:
i = 1 s = 1 s = s *2 = 2;
i = 2 s = 2 s = s *2 = 4;
i = 3 s = 4 s = 4 *2 = 8;
输出打印:8 为什么结果是64?