记录详情

Compile Error

foo.cc: In function 'int search(std::string&, std::string&, int)':
foo.cc:11:14: error: expected unqualified-id before 'int'
   11 |  for(int j=i,int starti=0;j<=s1.length();j++)
      |              ^~~
foo.cc:11:14: error: expected ';' before 'int'
   11 |  for(int j=i,int starti=0;j<=s1.length();j++)
      |              ^~~
      |              ;
foo.cc:11:28: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   11 |  for(int j=i,int starti=0;j<=s1.length();j++)
      |                           ~^~~~~~~~~~~~~
foo.cc:11:28: warning: value computed is not used [-Wunused-value]
foo.cc:11:41: error: expected ')' before ';' token
   11 |  for(int j=i,int starti=0;j<=s1.length();j++)
      |     ~                                   ^
      |                                         )
foo.cc:11:2: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   11 |  for(int j=i,int starti=0;j<=s1.length();j++)
      |  ^~~
foo.cc:11:42: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   11 |  for(int j=i,int starti=0;j<=s1.length();j++)
      |                                          ^
foo.cc:11:18: warning: unused variable 'starti' [-Wunused-variable]
   11 |  for(int j=i,int starti=0;j<=s1.length();j++)
      |                  ^~~~~~
foo.cc:11:42: error: 'j' was not declared in this scope
   11 |  for(int j=i,int starti=0;j<=s1.length();j++)
      |                                          ^
foo.cc: In function 'int main()':
foo.cc:27:14: error: expected unqualified-id before 'int'
   27 |  for(int j=i,int k=0;j<=s3.length()&&j!=-1;j++,k++)
      |              ^~~
foo.cc:27:14: error: expected ';' before 'int'
   27 |  for(int j=i,int k=0;j<=s3.length()&&j!=-1;j++,k++)
      |              ^~~
      |              ;
foo.cc:27:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   27 |  for(int j=i,int k=0;j<=s3.length()&&j!=-1;j++,k++)
      |                      ~^~~~~~~~~~~~~
foo.cc:27:43: error: expected ')' before ';' token
   27 |  for(int j=i,int k=0;j<=s3.length()&&j!=-1;j++,k++)
      |     ~                                     ^
      |                                           )
foo.cc:27:2: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   27 |  for(int j=i,int k=0;j<=s3.length()&&j!=-1;j++,k++)
      |  ^~~
foo.cc:27:44: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   27 |  for(int j=i,int k=0;j<=s3.length()&&j!=-1;j++,k++)
      |                                            ^
foo.cc:27:18: warning: unused variable 'k' [-Wunused-variable]
   27 |  for(int j=i,int k=0;j<=s3.length()&&j!=-1;j++,k++)
      |                  ^
foo.cc:27:44: error: 'j' was not declared in this scope
   27 |  for(int j=i,int k=0;j<=s3.length()&&j!=-1;j++,k++)
      |                                            ^
foo.cc:27:48: error: 'k' was not declared in this scope
   27 |  for(int j=i,int k=0;j<=s3.length()&&j!=-1;j++,k++)
      |                                                ^
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1052 OO11-4 string中的查找替换
比赛
2022春 面向对象程序设计方法的上机作业
语言
C++
递交时间
2022-05-16 20:39:57
评测时间
2022-05-16 20:39:57
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes