记录详情

Compile Error

foo.c:6:5: error: unknown type name 'Node'
    6 |     Node* next;
      |     ^~~~
foo.c:9:2: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
    9 |  Node* createNode(int data)
      |  ^~~~
      |  struct 
foo.c: In function 'createNode':
foo.c:11:6: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
   11 |      Node* newp = new Node;
      |      ^~~~
      |      struct 
foo.c:11:19: error: 'new' undeclared (first use in this function); did you mean 'newp'?
   11 |      Node* newp = new Node;
      |                   ^~~
      |                   newp
foo.c:11:19: note: each undeclared identifier is reported only once for each function it appears in
foo.c:11:23: error: expected ',' or ';' before 'Node'
   11 |      Node* newp = new Node;
      |                       ^~~~
foo.c:12:10: error: request for member 'data' in something not a structure or union
   12 |      newp->data = data;
      |          ^~
foo.c:13:10: error: request for member 'next' in something not a structure or union
   13 |      newp->next = NULL;
      |          ^~
foo.c: At top level:
foo.c:17:15: error: unknown type name 'Node'
   17 | void FindMaxs(Node* head)
      |               ^~~~
foo.c: In function 'main':
foo.c:49:5: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
   49 |     Node* headA = NULL;
      |     ^~~~
      |     struct 
foo.c:50:5: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
   50 |     Node* tailA = NULL;
      |     ^~~~
      |     struct 
foo.c:52:5: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
   52 |     Node* headB = NULL;
      |     ^~~~
      |     struct 
foo.c:53:5: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
   53 |     Node* tailB = NULL;
      |     ^~~~
      |     struct 
foo.c:57:9: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
   57 |         Node* newp = createNode(data);
      |         ^~~~
      |         struct 
foo.c:65:18: error: request for member 'next' in something not a structure or union
   65 |             tailA->next = newp;
      |                  ^~
foo.c:72:9: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
   72 |         Node* newp = createNode(data);
      |         ^~~~
      |         struct 
foo.c:80:18: error: request for member 'next' in something not a structure or union
   80 |             tailB->next = newp;
      |                  ^~
foo.c:84:5: warning: implicit declaration of function 'FindMaxs' [-Wimplicit-function-declaration]
   84 |     FindMaxs(headA);
      |     ^~~~~~~~
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
A9-7 数组中所有极大值
比赛
2023 程序设计与竞赛(作业8:链表的世界)
语言
C
递交时间
2023-11-25 17:50:59
评测时间
2023-11-25 17:50:59
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes