记录详情

Compile Error

foo.cc: In function 'bool Equal(char*, char*, int)':
foo.cc:7:25: error: 'strlen' was not declared in this scope
    7 |     for (int j = 0; j < strlen(t); j++)
      |                         ^~~~~~
foo.cc:3:1: note: 'strlen' is defined in header '<cstring>'; did you forget to '#include <cstring>'?
    2 | #include <string>
  +++ |+#include <cstring>
    3 | using namespace std;
foo.cc: In function 'int main()':
foo.cc:19:25: error: 'strlen' was not declared in this scope
   19 |     for (int i = 0; i < strlen(s) - strlen(t) + 1; i+=strlen(t))
      |                         ^~~~~~
foo.cc:19:25: note: 'strlen' is defined in header '<cstring>'; did you forget to '#include <cstring>'?
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1051 OO11-3 string中的查找
比赛
2023春面向对象的程序设计方法(3)
语言
C++
递交时间
2023-05-28 14:35:18
评测时间
2023-05-28 14:35:18
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes