记录详情

Compile Error

/in/foo.c:3:17: error: parameter 'n' has just a forward declaration
 int FindMin(int n;int a[])
                 ^
/in/foo.c: In function 'FindMin':
/in/foo.c:6:16: error: 'n' undeclared (first use in this function)
  for(int i=1;i<n;i++)
                ^
/in/foo.c:6:16: note: each undeclared identifier is reported only once for each function it appears in
/in/foo.c: In function 'main':
/in/foo.c:16:2: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
  for(int i=0;i<n;i++)
  ^~~
/in/foo.c:18:5: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'for'
     int k=FindMin(n,a[n]);
     ^~~
/in/foo.c:18:19: warning: passing argument 1 of 'FindMin' makes pointer from integer without a cast [-Wint-conversion]
     int k=FindMin(n,a[n]);
                   ^
/in/foo.c:3:5: note: expected 'int *' but argument is of type 'int'
 int FindMin(int n;int a[])
     ^~~~~~~
/in/foo.c:18:11: error: too many arguments to function 'FindMin'
     int k=FindMin(n,a[n]);
           ^~~~~~~
/in/foo.c:3:5: note: declared here
 int FindMin(int n;int a[])
     ^~~~~~~

信息

递交者
类型
自测
题目
A7-2 数组的极值函数
语言
C
递交时间
2023-11-28 14:00:10
评测时间
2023-11-28 14:00:10
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes