记录详情

Compile Error

foo.cc: In function 'int StringPatternMatch(std::string&, std::string&)':
foo.cc:20:13: warning: unused variable 'i' [-Wunused-variable]
   20 |         int i, j;
      |             ^
foo.cc:20:16: warning: unused variable 'j' [-Wunused-variable]
   20 |         int i, j;
      |                ^
foo.cc:21:13: warning: unused variable 'nIndexTag' [-Wunused-variable]
   21 |         int nIndexTag;
      |             ^~~~~~~~~
foo.cc: In function 'int main(int, char**)':
foo.cc:52:13: warning: 'char* gets(char*)' is deprecated [-Wdeprecated-declarations]
   52 |         gets(ary_cParent);
      |         ~~~~^~~~~~~~~~~~~
In file included from /nix/store/r0n0bpr0s38f02hyg0akd63yxc1d2n86-gcc/include/c++/12.3.0/cstdio:42,
                 from /nix/store/r0n0bpr0s38f02hyg0akd63yxc1d2n86-gcc/include/c++/12.3.0/ext/string_conversions.h:43,
                 from /nix/store/r0n0bpr0s38f02hyg0akd63yxc1d2n86-gcc/include/c++/12.3.0/bits/basic_string.h:3968,
                 from /nix/store/r0n0bpr0s38f02hyg0akd63yxc1d2n86-gcc/include/c++/12.3.0/string:53,
                 from foo.cc:3:
/nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/stdio.h:605:14: note: declared here
  605 | extern char *gets (char *__s) __wur __attribute_deprecated__;
      |              ^~~~
foo.cc:53:13: warning: 'char* gets(char*)' is deprecated [-Wdeprecated-declarations]
   53 |         gets(ary_cSub);
      |         ~~~~^~~~~~~~~~
/nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/stdio.h:605:14: note: declared here
  605 | extern char *gets (char *__s) __wur __attribute_deprecated__;
      |              ^~~~
foo.cc:59:9: error: 'cout' was not declared in this scope
   59 |         cout << nCount;
      |         ^~~~
foo.cc:4:1: note: 'std::cout' is defined in header '<iostream>'; did you forget to '#include <iostream>'?
    3 | #include <string>
  +++ |+#include <iostream>
    4 | using namespace std;
foo.cc:49:13: warning: unused variable 'nSubLength' [-Wunused-variable]
   49 |         int nSubLength = 0, nCount = 0, nPosition = 0;
      |             ^~~~~~~~~~
foo.cc:49:41: warning: unused variable 'nPosition' [-Wunused-variable]
   49 |         int nSubLength = 0, nCount = 0, nPosition = 0;
      |                                         ^~~~~~~~~
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1051 OO11-3 string中的查找
语言
C++
递交时间
2023-10-19 10:24:10
评测时间
2023-10-19 10:24:10
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes