迭代器访问容器 [英] Iterators Accessing Container

查看:116
本文介绍了迭代器访问容器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以解释迭代器如何访问容器吗?我已经阅读了许多评论,但似乎并没有得到太多的信息.

非常感谢您的帮助.

非常感谢.

Can someone explain how iterators access containers? I''ve read a number of review but don''t really seem to be getting much information on it.

Your help is much appreciated.

Thanks much.

推荐答案

请参阅我对问题的评论.

在所有情况下,您都需要学习迭代器:
http://en.wikipedia.org/wiki/Iterator [ http://www.cplusplus.com/reference/std/iterator/ [ http://en.cppreference.com/w/cpp/iterator [ http://stackoverflow.com/questions/409348/iteration-over-vector-in-c [^ ].

使用Java,请参阅:
http://docs.oracle.com/javase/1.5.0/docs/guide/language/foreach.html [ ^ ];
另请参见:
http://stackoverflow.com/questions/85190/how-does- the-java-for-each-loop-work [ ^ ].

—SA
Please see my comment to the question.

In all cases, you need to learn iterators:
http://en.wikipedia.org/wiki/Iterator[^].

With C++:
http://www.cplusplus.com/reference/std/iterator/[^],
http://en.cppreference.com/w/cpp/iterator[^].

See also:
http://stackoverflow.com/questions/409348/iteration-over-vector-in-c[^].

With Java, please see:
http://docs.oracle.com/javase/1.5.0/docs/guide/language/foreach.html[^];
see also:
http://stackoverflow.com/questions/85190/how-does-the-java-for-each-loop-work[^].

—SA


这篇关于迭代器访问容器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆