void Change(string &s,const string &oldVal,const string &newVal) {
auto l = oldVal.size();
if (!l)
return;
auto a = s.begin();
while (a <= s.end()-l) {
auto b = a;
auto c = oldVal.begin();
while (c!=oldVal.end()&&*b=*c) { //这里报错显示c不可以修改
b++;
c++;
}
}
}
c是一个常量string的迭代器,报错表达式必须是可修改的左值,把const string改成string仍然没有用。
*b==*c