记录详情

Compile Error

foo.c:6:5: error: unknown type name 'Node'
    6 |     Node* next;
      |     ^~~~
foo.c: In function 'CountMin':
foo.c:16:24: warning: initialization of 'struct Node *' from incompatible pointer type 'int *' [-Wincompatible-pointer-types]
   16 |     struct Node* temp= head->next;
      |                        ^~~~
foo.c:23:14: warning: assignment to 'struct Node *' from incompatible pointer type 'int *' [-Wincompatible-pointer-types]
   23 |         temp = temp->next;
      |              ^
foo.c:33:14: warning: assignment to 'struct Node *' from incompatible pointer type 'int *' [-Wincompatible-pointer-types]
   33 |         temp = temp->next;
      |              ^
foo.c: In function 'main':
foo.c:41:5: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
   41 |     Node* head = NULL;
      |     ^~~~
      |     struct 
foo.c:42:5: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
   42 |     Node* tail = NULL;
      |     ^~~~
      |     struct 
foo.c:47:10: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
   47 |          Node* newp =new Node;
      |          ^~~~
      |          struct 
foo.c:47:22: error: 'new' undeclared (first use in this function); did you mean 'newp'?
   47 |          Node* newp =new Node;
      |                      ^~~
      |                      newp
foo.c:47:22: note: each undeclared identifier is reported only once for each function it appears in
foo.c:47:26: error: expected ',' or ';' before 'Node'
   47 |          Node* newp =new Node;
      |                          ^~~~
foo.c:48:26: error: request for member 'data' in something not a structure or union
   48 |         scanf("%d", &newp->data);
      |                          ^~
foo.c:49:13: error: request for member 'next' in something not a structure or union
   49 |         newp->next = NULL;
      |             ^~
foo.c:57:17: error: request for member 'next' in something not a structure or union
   57 |             tail->next = newp;
      |                 ^~
foo.c:61:5: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
   61 |     Node* head2 = NULL;
      |     ^~~~
      |     struct 
foo.c:62:5: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
   62 |     Node* tail2 = NULL;
      |     ^~~~
      |     struct 
foo.c:65:9: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
   65 |         Node* newp = new Node;
      |         ^~~~
      |         struct 
foo.c:65:26: error: expected ',' or ';' before 'Node'
   65 |         Node* newp = new Node;
      |                          ^~~~
foo.c:66:26: error: request for member 'data' in something not a structure or union
   66 |         scanf("%d", &newp->data);
      |                          ^~
foo.c:67:13: error: request for member 'next' in something not a structure or union
   67 |         newp->next = NULL;
      |             ^~
foo.c:75:18: error: request for member 'next' in something not a structure or union
   75 |             tail2->next = newp;
      |                  ^~
foo.c:79:25: warning: passing argument 1 of 'CountMin' from incompatible pointer type [-Wincompatible-pointer-types]
   79 |     int min1 = CountMin(head);
      |                         ^~~~
      |                         |
      |                         int *
foo.c:9:27: note: expected 'struct Node *' but argument is of type 'int *'
    9 | int CountMin(struct Node* head)
      |              ~~~~~~~~~~~~~^~~~
foo.c:80:25: warning: passing argument 1 of 'CountMin' from incompatible pointer type [-Wincompatible-pointer-types]
   80 |     int min2 = CountMin(head2);
      |                         ^~~~~
      |                         |
      |                         int *
foo.c:9:27: note: expected 'struct Node *' but argument is of type 'int *'
    9 | int CountMin(struct Node* head)
      |              ~~~~~~~~~~~~~^~~~
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
A9-5 数组中最小值的个数
比赛
2023 程序设计与竞赛(作业8:链表的世界)
语言
C
递交时间
2023-11-25 12:35:27
评测时间
2023-11-25 12:35:27
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes