记录详情

Compile Error

foo.c: In function 'ad':
foo.c:4:31: error: subscripted value is neither array nor pointer nor vector
    4 |  for(i=0; i<m ;i++)   max=a[i][0];
      |                               ^
foo.c:7:11: error: subscripted value is neither array nor pointer nor vector
    7 |    if(a[i][j]>a[i][0])  max=a[i][j];
      |           ^
foo.c:7:19: error: subscripted value is neither array nor pointer nor vector
    7 |    if(a[i][j]>a[i][0])  max=a[i][j];
      |                   ^
foo.c:7:33: error: subscripted value is neither array nor pointer nor vector
    7 |    if(a[i][j]>a[i][0])  max=a[i][j];
      |                                 ^
foo.c:9:31: error: subscripted value is neither array nor pointer nor vector
    9 |  for(j=0; j<n ;j++)   min=a[0][j];
      |                               ^
foo.c:12:11: error: subscripted value is neither array nor pointer nor vector
   12 |    if(a[i][j]<a[0][j])  min=a[i][j];
      |           ^
foo.c:12:19: error: subscripted value is neither array nor pointer nor vector
   12 |    if(a[i][j]<a[0][j])  min=a[i][j];
      |                   ^
foo.c:12:33: error: subscripted value is neither array nor pointer nor vector
   12 |    if(a[i][j]<a[0][j])  min=a[i][j];
      |                                 ^
foo.c: At top level:
foo.c:18:6: warning: return type of 'main' is not 'int' [-Wmain]
   18 | void main()
      |      ^~~~
foo.c: In function 'main':
foo.c:20:17: error: 'm' undeclared (first use in this function)
   20 |  scanf("%d %d",&m,&n);
      |                 ^
foo.c:20:17: note: each undeclared identifier is reported only once for each function it appears in
foo.c:20:20: error: 'n' undeclared (first use in this function)
   20 |  scanf("%d %d",&m,&n);
      |                    ^
foo.c:24:5: warning: passing argument 1 of 'ad' from incompatible pointer type [-Wincompatible-pointer-types]
   24 |  ad(a,m,n);
      |     ^
      |     |
      |     int (*)[500]
foo.c:2:14: note: expected 'int *' but argument is of type 'int (*)[500]'
    2 | void ad(int *a,int m,int n)
      |         ~~~~~^
foo.c:23:3: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
   23 |   scanf("%d",&a[i][j]);
      |   ^~~~~~~~~~~~~~~~~~~~
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
4-5 有几个鞍点
比赛
2022春 C语言课程设计 作业3
语言
C
递交时间
2022-05-02 22:12:29
评测时间
2022-05-02 22:12:29
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes