记录详情

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

信息

递交者
类型
递交
题目
A7-5 数组的有序插入函数
比赛
2023 程序设计与竞赛(作业8:链表的世界)
语言
C
递交时间
2023-11-25 12:10:00
评测时间
2023-11-25 12:10:00
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes