记录详情

Compile Error

/in/foo.c:2:16: warning: 'struct aa' declared inside parameter list will not be visible outside of this definition or declaration
 int com(struct aa *t,int n);
                ^~
/in/foo.c: In function 'main':
/in/foo.c:12:1: error: unknown type name 'aa'
 aa *t;
 ^~
/in/foo.c:12:1: note: use 'struct' keyword to refer to the type
/in/foo.c:13:3: error: 'new' undeclared (first use in this function)
 t=new aa[n];
   ^~~
/in/foo.c:13:3: note: each undeclared identifier is reported only once for each function it appears in
/in/foo.c:13:7: error: expected ';' before 'aa'
 t=new aa[n];
       ^~
/in/foo.c:16:6: error: request for member 'b' in something not a structure or union
  t[i].b=i;
      ^
/in/foo.c:17:18: error: request for member 'a' in something not a structure or union
  scanf("%d",&t[i].a);
                  ^
/in/foo.c:21:8: warning: passing argument 1 of 'com' from incompatible pointer type [-Wincompatible-pointer-types]
 {n=com(t,n);
        ^
/in/foo.c:2:5: note: expected 'struct aa *' but argument is of type 'int *'
 int com(struct aa *t,int n);
     ^~~
/in/foo.c:24:20: error: request for member 'b' in something not a structure or union
 printf("%d %d",t[1].b,t[2].b);
                    ^
/in/foo.c:24:27: error: request for member 'b' in something not a structure or union
 printf("%d %d",t[1].b,t[2].b);
                           ^
/in/foo.c:25:1: error: 'delete' undeclared (first use in this function)
 delete []t;
 ^~~~~~
/in/foo.c:25:9: error: expected expression before ']' token
 delete []t;
         ^
/in/foo.c:10:7: warning: unused variable 's' [-Wunused-variable]
 int n,s;
       ^
/in/foo.c: At top level:
/in/foo.c:28:5: error: conflicting types for 'com'
 int com(struct aa *t,int n)
     ^~~
/in/foo.c:2:5: note: previous declaration of 'com' was here
 int com(struct aa *t,int n);
     ^~~

信息

递交者
类型
递交
题目
P1297 D. Jabberwocky
比赛
南京师范大学2021年11月程序设计竞赛
语言
C
递交时间
2021-11-21 17:27:22
评测时间
2021-11-21 17:27:22
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes