Compile Error

foo.c:1:9: error: #include expects "FILENAME" or <FILENAME>
    1 | #include“stdio.h”
      |         ^
foo.c:5:9: error: unknown type name 'Node'
    5 |         Node* next;
      |         ^~~~
foo.c:7:1: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
    7 | Node* Create(int n)
      | ^~~~
      | struct 
foo.c: In function 'Create':
foo.c:9:9: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
    9 |         Node* head = NULL; Node* Tail = NULL;
      |         ^~~~
      |         struct 
foo.c:9:22: error: 'NULL' undeclared (first use in this function)
    9 |         Node* head = NULL; Node* Tail = NULL;
      |                      ^~~~
foo.c:1:1: note: 'NULL' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
  +++ |+#include <stddef.h>
    1 | #include“stdio.h”
foo.c:9:22: note: each undeclared identifier is reported only once for each function it appears in
    9 |         Node* head = NULL; Node* Tail = NULL;
      |                      ^~~~
foo.c:9:28: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
    9 |         Node* head = NULL; Node* Tail = NULL;
      |                            ^~~~
      |                            struct 
foo.c:13:17: warning: implicit declaration of function 'scanf_s' [-Wimplicit-function-declaration]
   13 |                 scanf_s("%d", &x);
      |                 ^~~~~~~
foo.c:14:17: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
   14 |                 Node*newp = new Node; newp->date = x;
      |                 ^~~~
      |                 struct 
foo.c:14:29: error: 'new' undeclared (first use in this function); did you mean 'newp'?
   14 |                 Node*newp = new Node; newp->date = x;
      |                             ^~~
      |                             newp
foo.c:14:33: error: expected ',' or ';' before 'Node'
   14 |                 Node*newp = new Node; newp->date = x;
      |                                 ^~~~
foo.c:14:43: error: request for member 'date' in something not a structure or union
   14 |                 Node*newp = new Node; newp->date = x;
      |                                           ^~
foo.c:18:29: error: request for member 'next' in something not a structure or union
   18 |                         Tail->next = newp;
      |                             ^~
foo.c:22:21: error: request for member 'next' in something not a structure or union
   22 |                 Tail->next = NULL;
      |                     ^~
foo.c: At top level:
foo.c:25:12: error: unknown type name 'Node'
   25 | int search(Node*head,int x)
      |            ^~~~
foo.c: In function 'main':
foo.c:41:9: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
   41 |         Node*head = Create(n);
      |         ^~~~
      |         struct 
foo.c:46:17: warning: implicit declaration of function 'search' [-Wimplicit-function-declaration]
   46 |         int cnt=search(head, x);
      |                 ^~~~~~
foo.c:47:9: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   47 |         printf("%d\n", cnt);
      |         ^~~~~~
foo.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf'
  +++ |+#include <stdio.h>
    1 | #include“stdio.h”
foo.c:47:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   47 |         printf("%d\n", cnt);
      |         ^~~~~~
foo.c:47:9: note: include '<stdio.h>' or provide a declaration of 'printf'
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1047 A7-4 数组的查找函数
语言
C
递交时间
2023-11-25 09:39:36
评测时间
2023-11-25 09:39:36
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes