嗨,所以我有点困惑迭代器和它们实际上是......在C++ STL中
在这种情况下我使用列表,我不明白你为什么要做一个迭代器: std::list <int>::const_iterator iElementLocator;
std::list <int>::const_iterator iElementLocator;
由derefrence运算符dipslay列表的内容: cout << *iElementLocator;
cout << *iElementLocator;
将它分配给list.begin()之后;
请解释一下迭代器究竟是什么以及我为什么要使用它/使用它! 谢谢!!
c++ iterator stl
c++ ×1
iterator ×1
stl ×1