记录详情

Compile Error

/in/foo.c:4:2: error: unknown type name 'Node'
  Node* next;
  ^~~~
/in/foo.c:6:1: error: unknown type name 'Node'
 Node* create(int arr[], int n) {
 ^~~~
/in/foo.c:6:1: note: use 'struct' keyword to refer to the type
/in/foo.c: In function 'create':
/in/foo.c:7:2: error: unknown type name 'Node'
  Node* head = NULL;
  ^~~~
/in/foo.c:7:2: note: use 'struct' keyword to refer to the type
/in/foo.c:10:3: error: unknown type name 'Node'
   Node* newp = new Node;
   ^~~~
/in/foo.c:10:3: note: use 'struct' keyword to refer to the type
/in/foo.c:10:16: error: 'new' undeclared (first use in this function)
   Node* newp = new Node;
                ^~~
/in/foo.c:10:16: note: each undeclared identifier is reported only once for each function it appears in
/in/foo.c:10:20: error: expected ',' or ';' before 'Node'
   Node* newp = new Node;
                    ^~~~
/in/foo.c:11:7: error: request for member 'data' in something not a structure or union
   newp->data = arr[i];
       ^~
/in/foo.c:12:7: error: request for member 'next' in something not a structure or union
   newp->next = head;
       ^~
/in/foo.c: At top level:
/in/foo.c:17:12: error: unknown type name 'Node'
 int Search(Node* head,int x) {
            ^~~~
/in/foo.c: In function 'main':
/in/foo.c:26:2: error: unknown type name 'Node'
  Node* head = NULL;
  ^~~~
/in/foo.c:26:2: note: use 'struct' keyword to refer to the type
/in/foo.c:33:15: warning: implicit declaration of function 'Search' [-Wimplicit-function-declaration]
  printf("%d", Search(head, x));
               ^~~~~~

信息

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