记录详情

Compile Error

foo.c: In function 'main':
foo.c:18:14: error: 'new' undeclared (first use in this function)
   18 |     int *a = new int[na];
      |              ^~~
foo.c:18:14: note: each undeclared identifier is reported only once for each function it appears in
foo.c:18:18: error: expected ',' or ';' before 'int'
   18 |     int *a = new int[na];
      |                  ^~~
foo.c:19:22: error: expected ',' or ';' before 'int'
   19 |         int *b = new int[nb];
      |                      ^~~
foo.c:20:22: error: expected ',' or ';' before 'int'
   20 |         int *c = new int[nc];
      |                      ^~~
foo.c:21:22: error: expected ',' or ';' before 'int'
   21 |         int *d = new int[na + nb];
      |                      ^~~
foo.c:22:22: error: expected ',' or ';' before 'int'
   22 |         int *e = new int[na + nc];
      |                      ^~~
foo.c:24:20: warning: format '%d' expects argument of type 'int *', but argument 2 has type 'int' [-Wformat=]
   24 |            scanf("%d\n",a[i]);
      |                   ~^    ~~~~
      |                    |     |
      |                    int * int
foo.c:26:20: warning: format '%d' expects argument of type 'int *', but argument 2 has type 'int' [-Wformat=]
   26 |            scanf("%d\n",b[j]);
      |                   ~^    ~~~~
      |                    |     |
      |                    int * int
foo.c:28:20: warning: format '%d' expects argument of type 'int *', but argument 2 has type 'int' [-Wformat=]
   28 |            scanf("%d",c[k]);
      |                   ~^  ~~~~
      |                    |   |
      |                    |   int
      |                    int *
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
自测
题目
A10-1 有序数组的合并
语言
C
递交时间
2023-11-28 15:14:38
评测时间
2023-11-28 15:14:38
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes