记录详情

Compile Error

foo.c:5:9: error: unknown type name 'Node'
    5 |         Node* next;
      |         ^~~~
foo.c:7:12: error: unknown type name 'Node'
    7 | int Search(Node* head,int x,int n)
      |            ^~~~
foo.c:17:1: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
   17 | Node* InsertHead(Node* head, int x)
      | ^~~~
      | struct 
foo.c:17:18: error: unknown type name 'Node'
   17 | Node* InsertHead(Node* head, int x)
      |                  ^~~~
foo.c:24:1: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
   24 | Node* Create(int a[],int n)
      | ^~~~
      | struct 
foo.c: In function 'Create':
foo.c:26:9: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
   26 |         Node* head = NULL;
      |         ^~~~
      |         struct 
foo.c:30:24: warning: implicit declaration of function 'InsertHead' [-Wimplicit-function-declaration]
   30 |                 head = InsertHead(head, a[i]);
      |                        ^~~~~~~~~~
foo.c:30:22: warning: assignment to 'int *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
   30 |                 head = InsertHead(head, a[i]);
      |                      ^
foo.c: In function 'main':
foo.c:39:9: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
   39 |         Node* head = Create(a, n);
      |         ^~~~
      |         struct 
foo.c:42:17: warning: implicit declaration of function 'Search' [-Wimplicit-function-declaration]
   42 |         int p = Search(head, x,n);
      |                 ^~~~~~
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P2902 A7-4 数组的查找函数
语言
C
递交时间
2023-11-26 14:58:16
评测时间
2023-11-26 14:58:16
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes