|
void initList (list <string>&slist, const vector <string>&svec)
{
vector <string> :: const_iterator cit = svec.begin ();
// while (cit! = svec.end ())
// {
// slist.push_front (* cit);
//}
cit = svec.begin ();
for (; cit! = svec.end (); ++ cit)
{
slist.push_back (* cit);
}
}
The program is always in the processing state, and the for version can be executed correctly. It is found that there may be a problem with cit! = Svec.end (), but it is not understood.
Master a lot of advice |
|