您的位置:首页 > 其它

一个极其幼稚的错误,再犯就可以去死了

2011-09-27 19:56 99 查看
#include<stdio.h>
#define SIZE 5;
void print1(int *a)
{
int i;
for(i=0; i < SIZE; i++)        //expected expression before ';' token
printf("%d\n",a[i]);
}
void print2(int a[])
{
int i;
for(i=0;i < SIZE;i++)        //expected expression before ';' token
printf("%d\n",a[i]);
}
int main(int argc,char **argv)
{
int a[SIZE] = {1,2,3,4,5};    //expected ']' before ';' token
print1(a);
//passArray.c|18| error: 'a' undeclared (first use in this function)
//passArray.c|18| error: (Each undeclared identifier is reported only once
//passArray.c|18| error: for each function it appears in.)
print2(a);
return 0;
}


看出来错误在哪了吗。。。。。。。。。。。。。。。。。。。。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐