记录详情

Compile Error

foo.c: In function 'Length':
foo.c:5:4: warning: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
    5 |  t=strlen(s);
      |    ^~~~~~
foo.c:5:4: warning: incompatible implicit declaration of built-in function 'strlen'
foo.c:2:1: note: include '<string.h>' or provide a declaration of 'strlen'
    1 | #include<stdio.h>
  +++ |+#include <string.h>
    2 | int Length(char s[])
foo.c: In function 'main':
foo.c:11:2: warning: 'gets' is deprecated [-Wdeprecated-declarations]
   11 |  gets(s1)!='\0';
      |  ^~~~
In file included from /usr/include/stdio.h:867,
                 from foo.c:1:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:235:1: note: declared here
  235 | gets (char *__str)
      | ^~~~
foo.c:11:10: warning: comparison between pointer and zero character constant [-Wpointer-compare]
   11 |  gets(s1)!='\0';
      |          ^~
foo.c:11:2: note: did you mean to dereference the pointer?
   11 |  gets(s1)!='\0';
      |  ^
foo.c:11:10: warning: value computed is not used [-Wunused-value]
   11 |  gets(s1)!='\0';
      |  ~~~~~~~~^~~~~~
foo.c:12:2: warning: 'gets' is deprecated [-Wdeprecated-declarations]
   12 |  gets(s2)!='\0';
      |  ^~~~
In file included from /usr/include/stdio.h:867,
                 from foo.c:1:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:235:1: note: declared here
  235 | gets (char *__str)
      | ^~~~
foo.c:12:10: warning: comparison between pointer and zero character constant [-Wpointer-compare]
   12 |  gets(s2)!='\0';
      |          ^~
foo.c:12:2: note: did you mean to dereference the pointer?
   12 |  gets(s2)!='\0';
      |  ^
foo.c:12:10: warning: value computed is not used [-Wunused-value]
   12 |  gets(s2)!='\0';
      |  ~~~~~~~~^~~~~~
foo.c:16:21: error: expected ';' before 'return'
   16 |  printf("%d,%d",a,b)
      |                     ^
      |                     ;
   17 |  return 0;
      |  ~~~~~~              
foo.c: In function 'Length':
foo.c:7:1: warning: control reaches end of non-void function [-Wreturn-type]
    7 | }
      | ^
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
比赛
2022春 C语言课程设计 作业3
语言
C
递交时间
2022-04-19 11:10:18
评测时间
2022-04-19 11:10:18
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes