主题:如何修改这段代码哦
#include<stdio.h>
void main()
{
int i,k,a[10];
for{
(i=0;i<10;i++)
a[i]=i;}
printf("%d\n",a[i]);
k=getchar();
}
我不明白这个错误为什么会出现
我该怎样修改才能通过调试
eleting intermediate files and output files for project 'input - Win32 Debug'.
--------------------Configuration: input - Win32 Debug--------------------
Compiling...
input.cpp
g:\071102020\input.cpp(5) : error C2059: syntax error : '{'
g:\071102020\input.cpp(5) : error C2143: syntax error : missing ';' before '{'
g:\071102020\input.cpp(6) : error C2143: syntax error : missing ')' before ';'
g:\071102020\input.cpp(6) : warning C4552: '<' : operator has no effect; expected operator with side-effect
g:\071102020\input.cpp(6) : error C2059: syntax error : ')'
g:\071102020\input.cpp(7) : error C2146: syntax error : missing ';' before identifier 'a'
执行 cl.exe 时出错.
input.exe - 1 error(s), 0 warning(s)
void main()
{
int i,k,a[10];
for{
(i=0;i<10;i++)
a[i]=i;}
printf("%d\n",a[i]);
k=getchar();
}
我不明白这个错误为什么会出现
我该怎样修改才能通过调试
eleting intermediate files and output files for project 'input - Win32 Debug'.
--------------------Configuration: input - Win32 Debug--------------------
Compiling...
input.cpp
g:\071102020\input.cpp(5) : error C2059: syntax error : '{'
g:\071102020\input.cpp(5) : error C2143: syntax error : missing ';' before '{'
g:\071102020\input.cpp(6) : error C2143: syntax error : missing ')' before ';'
g:\071102020\input.cpp(6) : warning C4552: '<' : operator has no effect; expected operator with side-effect
g:\071102020\input.cpp(6) : error C2059: syntax error : ')'
g:\071102020\input.cpp(7) : error C2146: syntax error : missing ';' before identifier 'a'
执行 cl.exe 时出错.
input.exe - 1 error(s), 0 warning(s)