Compile Error

foo.cc: In function 'int main()':
foo.cc:7:18: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
    7 |     cout<<strlen(a)<<' '<<strlen(b);
      |                  ^
      |                  |
      |                  char
In file included from /nix/store/wy4ywjsch9q2hj5lphqjdg9p2kf7w0ls-gcc-11.3.0/include/c++/11.3.0/cstring:42,
                 from /nix/store/wy4ywjsch9q2hj5lphqjdg9p2kf7w0ls-gcc-11.3.0/include/c++/11.3.0/x86_64-unknown-linux-gnu/bits/stdc++.h:48,
                 from foo.cc:1:
/nix/store/iczlqwdj10xiz3mmms6adnra0mn3ljk1-glibc-2.35-224-dev/include/string.h:407:35: note:   initializing argument 1 of 'size_t strlen(const char*)'
  407 | extern size_t strlen (const char *__s)
      |                       ~~~~~~~~~~~~^~~
foo.cc:7:34: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
    7 |     cout<<strlen(a)<<' '<<strlen(b);
      |                                  ^
      |                                  |
      |                                  char
In file included from /nix/store/wy4ywjsch9q2hj5lphqjdg9p2kf7w0ls-gcc-11.3.0/include/c++/11.3.0/cstring:42,
                 from /nix/store/wy4ywjsch9q2hj5lphqjdg9p2kf7w0ls-gcc-11.3.0/include/c++/11.3.0/x86_64-unknown-linux-gnu/bits/stdc++.h:48,
                 from foo.cc:1:
/nix/store/iczlqwdj10xiz3mmms6adnra0mn3ljk1-glibc-2.35-224-dev/include/string.h:407:35: note:   initializing argument 1 of 'size_t strlen(const char*)'
  407 | extern size_t strlen (const char *__s)
      |                       ~~~~~~~~~~~~^~~
[Hydro](https://hydro.ac)提供评测服务

信息

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