记录详情

Compile Error

foo.c:8:16: warning: 'struct Node' declared inside parameter list will not be visible outside of this definition or declaration
    8 | int max(struct Node* head) {
      |                ^~~~
foo.c: In function 'max':
foo.c:10:13: error: 'INT_MIN' undeclared (first use in this function)
   10 |     int max=INT_MIN;
      |             ^~~~~~~
foo.c:3:1: note: 'INT_MIN' is defined in header '<limits.h>'; did you forget to '#include <limits.h>'?
    2 | #include <malloc.h>
  +++ |+#include <limits.h>
    3 | 
foo.c:10:13: note: each undeclared identifier is reported only once for each function it appears in
   10 |     int max=INT_MIN;
      |             ^~~~~~~
foo.c:11:25: warning: initialization of 'struct node *' from incompatible pointer type 'struct Node *' [-Wincompatible-pointer-types]
   11 |     struct node* prev = head;
      |                         ^~~~
foo.c:12:24: warning: initialization of 'struct node *' from incompatible pointer type 'struct Node *' [-Wincompatible-pointer-types]
   12 |     struct node* cur = head;
      |                        ^~~~
foo.c:11:18: warning: variable 'prev' set but not used [-Wunused-but-set-variable]
   11 |     struct node* prev = head;
      |                  ^~~~
foo.c: In function 'main':
foo.c:62:15: warning: passing argument 1 of 'max' from incompatible pointer type [-Wincompatible-pointer-types]
   62 |     int x=max(head);
      |               ^~~~
      |               |
      |               struct node *
foo.c:8:22: note: expected 'struct Node *' but argument is of type 'struct node *'
    8 | int max(struct Node* head) {
      |         ~~~~~~~~~~~~~^~~~
foo.c:63:15: warning: passing argument 1 of 'max' from incompatible pointer type [-Wincompatible-pointer-types]
   63 |     int y=max(head2);
      |               ^~~~~
      |               |
      |               struct node *
foo.c:8:22: note: expected 'struct Node *' but argument is of type 'struct node *'
    8 | int max(struct Node* head) {
      |         ~~~~~~~~~~~~~^~~~
foo.c:67:5: error: expected declaration or statement at end of input
   67 |     return 0;
      |     ^~~~~~
[Hydro](https://hydro.ac)提供评测服务

信息

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