记录详情

Compile Error

foo.c:4:9: error: unknown type name 'Node'
    4 |         Node* next;
      |         ^~~~
foo.c:6:13: error: unknown type name 'Node'
    6 | void Output(Node* head) {
      |             ^~~~
foo.c:13:1: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
   13 | Node* create(int arr[], int n) {
      | ^~~~
      | struct 
foo.c: In function 'create':
foo.c:14:9: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
   14 |         Node* head = NULL;
      |         ^~~~
      |         struct 
foo.c:17:17: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
   17 |                 Node* newp = new Node;
      |                 ^~~~
      |                 struct 
foo.c:17:30: error: 'new' undeclared (first use in this function); did you mean 'newp'?
   17 |                 Node* newp = new Node;
      |                              ^~~
      |                              newp
foo.c:17:30: note: each undeclared identifier is reported only once for each function it appears in
foo.c:17:34: error: expected ',' or ';' before 'Node'
   17 |                 Node* newp = new Node;
      |                                  ^~~~
foo.c:18:21: error: request for member 'data' in something not a structure or union
   18 |                 newp->data = arr[i];
      |                     ^~
foo.c:19:21: error: request for member 'next' in something not a structure or union
   19 |                 newp->next = head;
      |                     ^~
foo.c: At top level:
foo.c:24:1: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
   24 | Node* Unique(Node* head) {
      | ^~~~
      | struct 
foo.c:24:14: error: unknown type name 'Node'
   24 | Node* Unique(Node* head) {
      |              ^~~~
foo.c: In function 'main':
foo.c:42:9: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
   42 |         Node* head1 = NULL,*head2=NULL;
      |         ^~~~
      |         struct 
foo.c:51:17: warning: implicit declaration of function 'Unique' [-Wimplicit-function-declaration]
   51 |         head1 = Unique(head1);
      |                 ^~~~~~
foo.c:51:15: warning: assignment to 'int *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
   51 |         head1 = Unique(head1);
      |               ^
foo.c:52:15: warning: assignment to 'int *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
   52 |         head2 = Unique(head2);
      |               ^
foo.c:53:9: warning: implicit declaration of function 'Output' [-Wimplicit-function-declaration]
   53 |         Output(head1);
      |         ^~~~~~
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
A10-3 数组的去重
比赛
2023 程序设计与竞赛(作业8:链表的世界)
语言
C
递交时间
2023-11-25 12:44:38
评测时间
2023-11-25 12:44:38
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes