[英]output console in Eclipse and arrays syntax
I'm new to programming and a bit confused with arrays, what seems to be wrong in this code, as eclipse output console is saying ** Build of configuration Debug for project Project ** 我是编程新手,对数组有点困惑,此代码似乎有问题,因为eclipse输出控制台在说**为项目Project建立配置调试**
Internal Builder is used for build ** gcc -O0 -g3 -Wall -c -fmessage-length=0 -omain.o ..\\main.c gcc -oProject.exe main.o C:...\\Documents\\eclipse\\mingw\\bin..\\lib\\gcc\\mingw32\\3.4.5........\\mingw32\\bin\\ld.exe: cannot open output file Project.exe: Permission denied collect2: ld returned 1 exit status Build error occurred, build is stopped Time consumed: 472 ms. 内部生成器用于构建** gcc -O0 -g3 -Wall -c -fmessage-length = 0 -omain.o .. \\ main.c gcc -oProject.exe main.o C:... \\ Documents \\ eclipse \\ mingw \\ bin .. \\ lib \\ gcc \\ mingw32 \\ 3.4.5 ........ \\ mingw32 \\ bin \\ ld.exe:无法打开输出文件Project.exe:权限被拒绝collect2:ld返回1退出状态发生构建错误,构建停止。耗时:472 ms。
I will really appreciate your help... 非常感谢您的帮助...
int main()
{
int box[2][2], rows, cols, x = 1;
for (rows=0; rows < 2; rows++)
{
for (cols=0; cols < 2; cols++)
{
box[rows][cols] = x++;
printf("%d", box[rows][cols]);
}
}
fflush(stdout);
getch();
return 0;
}
x ++是后递增的,因此使用x的值然后递增,因此box [0] [0]为1
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.