记录详情

Compile Error

foo.c:4:9: error: unknown type name 'Node'
    4 |         Node* next;
      |         ^~~~
foo.c:6:1: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
    6 | Node* create(int arr[], int n) {
      | ^~~~
      | struct 
foo.c: In function 'create':
foo.c:7:9: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
    7 |         Node* head = NULL;
      |         ^~~~
      |         struct 
foo.c:10:17: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
   10 |                 Node* newp = new Node;
      |                 ^~~~
      |                 struct 
foo.c:10:30: error: 'new' undeclared (first use in this function); did you mean 'newp'?
   10 |                 Node* newp = new Node;
      |                              ^~~
      |                              newp
foo.c:10:30: note: each undeclared identifier is reported only once for each function it appears in
foo.c:10:34: error: expected ',' or ';' before 'Node'
   10 |                 Node* newp = new Node;
      |                                  ^~~~
foo.c:11:21: error: request for member 'data' in something not a structure or union
   11 |                 newp->data = arr[i];
      |                     ^~
foo.c:12:21: error: request for member 'next' in something not a structure or union
   12 |                 newp->next = head;
      |                     ^~
foo.c: At top level:
foo.c:17:12: error: unknown type name 'Node'
   17 | int Search(Node* head,int x) {
      |            ^~~~
foo.c: In function 'main':
foo.c:26:9: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
   26 |         Node* head = NULL;
      |         ^~~~
      |         struct 
foo.c:33:22: warning: implicit declaration of function 'Search' [-Wimplicit-function-declaration]
   33 |         printf("%d", Search(head, x));
      |                      ^~~~~~
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1002 硕哥的最短路
语言
C
递交时间
2023-11-26 00:57:29
评测时间
2023-11-26 00:57:29
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes