记录详情

Compile Error

foo.c:8:28: error: unknown type name 'WordCount'
 int GetWordCount(char s[], WordCount WC[]);
                            ^~~~~~~~~
foo.c:9:12: error: unknown type name 'WordCount'
 int Insert(WordCount WC[],int n, WordCount wc);
            ^~~~~~~~~
foo.c:9:34: error: unknown type name 'WordCount'
 int Insert(WordCount WC[],int n, WordCount wc);
                                  ^~~~~~~~~
foo.c: In function 'main':
foo.c:13:2: warning: 'gets' is deprecated [-Wdeprecated-declarations]
  gets(s);
  ^~~~
In file included from /usr/include/stdio.h:862:0,
                 from foo.c:1:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:232:1: note: declared here
 gets (char *__str)
 ^~~~
foo.c:15:2: error: unknown type name 'WordCount'; use 'struct' keyword to refer to the type
  WordCount  WC[10000];  int n=0;
  ^~~~~~~~~
  struct 
foo.c:16:6: warning: implicit declaration of function 'GetWordCount' [-Wimplicit-function-declaration]
  n = GetWordCount(s, WC);
      ^~~~~~~~~~~~
foo.c:17:15: error: request for member 'count' in something not a structure or union
  int max=WC[0].count ;
               ^
foo.c:20:11: error: request for member 'count' in something not a structure or union
   if(WC[i].count>max)
           ^
foo.c:21:12: error: request for member 'count' in something not a structure or union
   max=WC[i].count;
            ^
foo.c:25:11: error: request for member 'count' in something not a structure or union
   if(WC[i].count==max)
           ^
foo.c:26:13: error: request for member 'Word' in something not a structure or union
   puts(WC[i].Word);
             ^
foo.c: At top level:
foo.c:30:28: error: unknown type name 'WordCount'
 int GetWordCount(char s[], WordCount WC[])
                            ^~~~~~~~~
foo.c:48:12: error: unknown type name 'WordCount'
 int Insert(WordCount WC[],int n, WordCount wc)
            ^~~~~~~~~
foo.c:48:34: error: unknown type name 'WordCount'
 int Insert(WordCount WC[],int n, WordCount wc)
                                  ^~~~~~~~~
foo.c: In function 'main':
foo.c:13:2: warning: ignoring return value of 'gets', declared with attribute warn_unused_result [-Wunused-result]
  gets(s);
  ^~~~~~~
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
6-9 哪个字母用得最多
比赛
2021(四) 作业第三场:热身赛
语言
C
递交时间
2021-11-15 18:05:32
评测时间
2021-11-15 18:05:32
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes