记录详情

Compile Error

/in/foo.c: In function 'main':
/in/foo.c:10:11: warning: format '%d' expects argument of type 'int *', but argument 2 has type 'int' [-Wformat=]
   scanf("%d",a[i]);
           ^
/in/foo.c:11:12: warning: passing argument 1 of 'Search' makes integer from pointer without a cast [-Wint-conversion]
  if(Search(a,m))
            ^
/in/foo.c:2:5: note: expected 'int' but argument is of type 'int *'
 int Search(int m);
     ^~~~~~
/in/foo.c:11:5: error: too many arguments to function 'Search'
  if(Search(a,m))
     ^~~~~~
/in/foo.c:2:5: note: declared here
 int Search(int m);
     ^~~~~~
/in/foo.c:12:22: warning: passing argument 1 of 'Search' makes integer from pointer without a cast [-Wint-conversion]
   printf("%d",Search(a,m));
                      ^
/in/foo.c:2:5: note: expected 'int' but argument is of type 'int *'
 int Search(int m);
     ^~~~~~
/in/foo.c:12:15: error: too many arguments to function 'Search'
   printf("%d",Search(a,m));
               ^~~~~~
/in/foo.c:2:5: note: declared here
 int Search(int m);
     ^~~~~~
/in/foo.c: At top level:
/in/foo.c:17:5: error: conflicting types for 'Search'
 int Search(int a[],int m)
     ^~~~~~
/in/foo.c:2:5: note: previous declaration of 'Search' was here
 int Search(int m);
     ^~~~~~
/in/foo.c: In function 'Search':
/in/foo.c:19:6: error: 'i' undeclared (first use in this function)
  for(i=0;i<n;i++)
      ^
/in/foo.c:19:6: note: each undeclared identifier is reported only once for each function it appears in
/in/foo.c:19:12: error: 'n' undeclared (first use in this function)
  for(i=0;i<n;i++)
            ^
/in/foo.c:23:4: error: expected ';' before 'break'
    break;
    ^~~~~
/in/foo.c:25:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^

信息

递交者
类型
自测
题目
A7-4 数组的查找函数
语言
C
递交时间
2019-04-21 21:55:17
评测时间
2019-04-21 21:55:17
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes