what's the problem?
Bool func (const char c)
{
return true;
}
Void main ()
{
String s (" 1 ");
For (auto I=s.c the begin (); Func (* I) & amp; & S.c end ()!=I; I++);//a runtime error, the iterator I cross-border
//for (auto I=s.c the begin (); S.c end ()!=I; I++);//run normally
}
CodePudding user response:
Because you have reached the tail, and then the error it solutions for reference of courseChange
For (auto I=s.c the begin (); S.c end ()!=i& & Func (* I); I++);