HelloWorld

ASM,C,LUA,LINUX(gentoo)
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

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

Posted on 2011-09-27 19:56  光铭  阅读(367)  评论(0)    收藏  举报
#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;
}

看出来错误在哪了吗。。。。。。。。。。。。。。。。。。。。