记录详情

Compile Error

foo.c: In function 'Count':
foo.c:5:10: error: 'i' undeclared (first use in this function)
    5 |  while(s[i]!='\0')
      |          ^
foo.c:5:10: note: each undeclared identifier is reported only once for each function it appears in
foo.c:8:4: error: 't' undeclared (first use in this function)
    8 |    t++;
      |    ^
foo.c:4:10: warning: unused variable 'y' [-Wunused-variable]
    4 |  int x=0,y=0;
      |          ^
foo.c: In function 'main':
foo.c:17:2: warning: 'gets' is deprecated [-Wdeprecated-declarations]
   17 |  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:17:10: warning: comparison between pointer and zero character constant [-Wpointer-compare]
   17 |  gets(s1)!='\0';
      |          ^~
foo.c:17:2: note: did you mean to dereference the pointer?
   17 |  gets(s1)!='\0';
      |  ^
foo.c:17:10: warning: value computed is not used [-Wunused-value]
   17 |  gets(s1)!='\0';
      |  ~~~~~~~~^~~~~~
foo.c:18:2: warning: 'gets' is deprecated [-Wdeprecated-declarations]
   18 |  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:18:10: warning: comparison between pointer and zero character constant [-Wpointer-compare]
   18 |  gets(s2)!='\0';
      |          ^~
foo.c:18:2: note: did you mean to dereference the pointer?
   18 |  gets(s2)!='\0';
      |  ^
foo.c:18:10: warning: value computed is not used [-Wunused-value]
   18 |  gets(s2)!='\0';
      |  ~~~~~~~~^~~~~~
foo.c: In function 'Count':
foo.c:12:1: warning: control reaches end of non-void function [-Wreturn-type]
   12 | }
      | ^
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
A8-2 字符串的统计函数
比赛
2022春 C语言课程设计 作业3
语言
C
递交时间
2022-04-18 23:50:10
评测时间
2022-04-18 23:50:10
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes