记录详情

Compile Error

foo.c:5:9: error: unknown type name 'Node'
    5 |         Node* next;
      |         ^~~~
foo.c:7:13: error: unknown type name 'Node'
    7 | void Output(Node* head)
      |             ^~~~
foo.c:16:1: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
   16 | Node* Create1()
      | ^~~~
      | struct 
foo.c: In function 'Create1':
foo.c:18:9: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
   18 |         Node* p1 = new Node; p1->data = 1;
      |         ^~~~
      |         struct 
foo.c:18:20: error: 'new' undeclared (first use in this function)
   18 |         Node* p1 = new Node; p1->data = 1;
      |                    ^~~
foo.c:18:20: note: each undeclared identifier is reported only once for each function it appears in
foo.c:18:24: error: expected ',' or ';' before 'Node'
   18 |         Node* p1 = new Node; p1->data = 1;
      |                        ^~~~
foo.c:18:32: error: request for member 'data' in something not a structure or union
   18 |         Node* p1 = new Node; p1->data = 1;
      |                                ^~
foo.c:19:9: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
   19 |         Node* p2 = new Node; p2->data = 2;
      |         ^~~~
      |         struct 
foo.c:19:24: error: expected ',' or ';' before 'Node'
   19 |         Node* p2 = new Node; p2->data = 2;
      |                        ^~~~
foo.c:19:32: error: request for member 'data' in something not a structure or union
   19 |         Node* p2 = new Node; p2->data = 2;
      |                                ^~
foo.c:20:9: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
   20 |         Node* p3 = new Node; p3->data = 3;
      |         ^~~~
      |         struct 
foo.c:20:24: error: expected ',' or ';' before 'Node'
   20 |         Node* p3 = new Node; p3->data = 3;
      |                        ^~~~
foo.c:20:32: error: request for member 'data' in something not a structure or union
   20 |         Node* p3 = new Node; p3->data = 3;
      |                                ^~
foo.c:21:9: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
   21 |         Node* p4 = new Node; p4->data = 4;
      |         ^~~~
      |         struct 
foo.c:21:24: error: expected ',' or ';' before 'Node'
   21 |         Node* p4 = new Node; p4->data = 4;
      |                        ^~~~
foo.c:21:32: error: request for member 'data' in something not a structure or union
   21 |         Node* p4 = new Node; p4->data = 4;
      |                                ^~
foo.c:23:11: error: request for member 'next' in something not a structure or union
   23 |         p1->next = p3;
      |           ^~
foo.c:24:11: error: request for member 'next' in something not a structure or union
   24 |         p3->next = p4;
      |           ^~
foo.c:25:11: error: request for member 'next' in something not a structure or union
   25 |         p4->next = p2;
      |           ^~
foo.c:26:11: error: request for member 'next' in something not a structure or union
   26 |         p2->next = NULL;
      |           ^~
foo.c: At top level:
foo.c:29:1: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
   29 | Node* Inserthead(Node* head, int x)
      | ^~~~
      | struct 
foo.c:29:18: error: unknown type name 'Node'
   29 | Node* Inserthead(Node* head, int x)
      |                  ^~~~
foo.c:35:1: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
   35 | Node* Create(int a[],int n)
      | ^~~~
      | struct 
foo.c: In function 'Create':
foo.c:37:9: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
   37 |         Node* head = new Node; head = NULL;
      |         ^~~~
      |         struct 
foo.c:37:22: error: 'new' undeclared (first use in this function)
   37 |         Node* head = new Node; head = NULL;
      |                      ^~~
foo.c:37:26: error: expected ',' or ';' before 'Node'
   37 |         Node* head = new Node; head = NULL;
      |                          ^~~~
foo.c:40:22: warning: implicit declaration of function 'Inserthead' [-Wimplicit-function-declaration]
   40 |                 head=Inserthead(head, a[i]);
      |                      ^~~~~~~~~~
foo.c:40:21: warning: assignment to 'int *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
   40 |                 head=Inserthead(head, a[i]);
      |                     ^
foo.c: At top level:
foo.c:45:1: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
   45 | Node* Deletehead(Node* head)
      | ^~~~
      | struct 
foo.c:45:18: error: unknown type name 'Node'
   45 | Node* Deletehead(Node* head)
      |                  ^~~~
foo.c:52:1: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
   52 | Node* Destroy(Node* head)
      | ^~~~
      | struct 
foo.c:52:15: error: unknown type name 'Node'
   52 | Node* Destroy(Node* head)
      |               ^~~~
foo.c:60:1: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
   60 | Node* Search(Node* head,int x)
      | ^~~~
      | struct 
foo.c:60:14: error: unknown type name 'Node'
   60 | Node* Search(Node* head,int x)
      |              ^~~~
foo.c:71:1: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
   71 | Node* SearchDelete(Node* head, int x)
      | ^~~~
      | struct 
foo.c:71:20: error: unknown type name 'Node'
   71 | Node* SearchDelete(Node* head, int x)
      |                    ^~~~
foo.c:92:17: error: unknown type name 'Node'
   92 | int IndexSearch(Node* head, int x)
      |                 ^~~~
foo.c:102:1: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
  102 | Node* Insert(Node* head, int x)
      | ^~~~
      | struct 
foo.c:102:14: error: unknown type name 'Node'
  102 | Node* Insert(Node* head, int x)
      |              ^~~~
foo.c:121:1: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
  121 | Node* Unique(Node* head)
      | ^~~~
      | struct 
foo.c:121:14: error: unknown type name 'Node'
  121 | Node* Unique(Node* head)
      |              ^~~~
foo.c:143:1: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
  143 | Node* SetUnion(Node* head1, Node* head2)
      | ^~~~
      | struct 
foo.c:143:16: error: unknown type name 'Node'
  143 | Node* SetUnion(Node* head1, Node* head2)
      |                ^~~~
foo.c:143:29: error: unknown type name 'Node'
  143 | Node* SetUnion(Node* head1, Node* head2)
      |                             ^~~~
foo.c:154:1: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
  154 | Node* Invert(Node* head)
      | ^~~~
      | struct 
foo.c:154:14: error: unknown type name 'Node'
  154 | Node* Invert(Node* head)
      |              ^~~~
foo.c:166:1: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
  166 | Node* SetInter(Node* head1, Node* head2)
      | ^~~~
      | struct 
foo.c:166:16: error: unknown type name 'Node'
  166 | Node* SetInter(Node* head1, Node* head2)
      |                ^~~~
foo.c:166:29: error: unknown type name 'Node'
  166 | Node* SetInter(Node* head1, Node* head2)
      |                             ^~~~
foo.c: In function 'main':
foo.c:192:9: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
  192 |         Node* head1 = Create(a1, n1);
      |         ^~~~
      |         struct 
foo.c:193:9: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
  193 |         Node* head2 = Create(a2, n2);
      |         ^~~~
      |         struct 
foo.c:194:9: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
  194 |         Node* head3 = Create(a3, n3);
      |         ^~~~
      |         struct 
foo.c:195:9: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
  195 |         Node* head11 = Create(a1, n1);
      |         ^~~~
      |         struct 
foo.c:196:9: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
  196 |         Node* head22 = Create(a2, n2);
      |         ^~~~
      |         struct 
foo.c:197:9: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
  197 |         Node* head33 = Create(a3, n3);
      |         ^~~~
      |         struct 
foo.c:199:17: warning: implicit declaration of function 'SetInter' [-Wimplicit-function-declaration]
  199 |         head1 = SetInter(head1, head2); head11 = SetInter(head11, head33);
      |                 ^~~~~~~~
foo.c:199:15: warning: assignment to 'int *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
  199 |         head1 = SetInter(head1, head2); head11 = SetInter(head11, head33);
      |               ^
foo.c:199:48: warning: assignment to 'int *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
  199 |         head1 = SetInter(head1, head2); head11 = SetInter(head11, head33);
      |                                                ^
foo.c:200:9: warning: implicit declaration of function 'Output' [-Wimplicit-function-declaration]
  200 |         Output(head1); Output(head11);
      |         ^~~~~~
foo.c:196:15: warning: unused variable 'head22' [-Wunused-variable]
  196 |         Node* head22 = Create(a2, n2);
      |               ^~~~~~
foo.c:194:15: warning: unused variable 'head3' [-Wunused-variable]
  194 |         Node* head3 = Create(a3, n3);
      |               ^~~~~
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
自测
语言
C
递交时间
2023-11-25 14:38:23
评测时间
2023-11-25 14:38:23
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes