std::list
strList.push_back(std::string("篮球"));
strList.push_back(std::string("羽毛球"));
strList.push_back(std::string("排球"));
for(std::list
// 还可以这样写,但是需要支持C++ 11标准的编译器
//for(auto iter = strList.begin(); iter != strList.end(); ++iter)
{
std::cout << *iter << std::endl;
}
list
LoveSports.push_back("篮球");
LoveSports.push_back("羽毛球");
LoveSports.push_back("排球");
list
for (; it != LoveSports.end(); it++)
{
cout<<*it<