开发平台(Platform): (Ex: VC++, GCC, Linux, ...)
VC++2010
请问
for循环{}有用跟没用有什么差别
a[0]=-1;
a[1]=1;
y=-1;
ex.1
for(j=0;j<2;j++)
x=y*a[j];
printf("%d",x);
出来的结果 -1
ex.2
for(j=0;j<2;j++)
{
x=y*a[j];
printf("%d",x);
}
出来的结果 1 -1
为什么出来的结果会不一样??
for出来的 1 -1 要怎么转到别的void 继续用呢??
到别的void 都只剩 -1
请各位大大帮帮忙 感激不尽