记录详情

Compile Error

foo.c: In function 'main':
foo.c:7:9: error: too few arguments to function 'fgets'
    7 |         fgets(s1);
      |         ^~~~~
In file included from foo.c:1:
/nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/stdio.h:592:14: note: declared here
  592 | extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
      |              ^~~~~
foo.c:8:9: error: too few arguments to function 'fgets'
    8 |         fgets(s2);
      |         ^~~~~
/nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/stdio.h:592:14: note: declared here
  592 | extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
      |              ^~~~~
foo.c:9:18: warning: format '%d' expects argument of type 'int', but argument 2 has type 'size_t' {aka 'long unsigned int'} [-Wformat=]
    9 |         printf("%d %d", strlen(s1), strlen(s2));
      |                 ~^      ~~~~~~~~~~
      |                  |      |
      |                  int    size_t {aka long unsigned int}
      |                 %ld
foo.c:9:21: warning: format '%d' expects argument of type 'int', but argument 3 has type 'size_t' {aka 'long unsigned int'} [-Wformat=]
    9 |         printf("%d %d", strlen(s1), strlen(s2));
      |                    ~^               ~~~~~~~~~~
      |                     |               |
      |                     int             size_t {aka long unsigned int}
      |                    %ld
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P2904 A8-1 字符串的输出函数
语言
C
递交时间
2023-10-28 17:39:40
评测时间
2023-10-28 17:39:40
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes