cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
list container question
list container question
Oct 18, 2013 at 10:54pm UTC
AeonFlux1212
(125)
Hi, I've been looking through containers in the reference section and I can't figure out how to access (i.e. READ) elements in a list...
any advice?
Thanks,
AeonFlux
Oct 18, 2013 at 11:08pm UTC
naraku9333
(2163)
You can access the first and last elements with front() and back() respectively. If you need to traverse the list use an iterator.
See
http://www.cplusplus.com/reference/list/list/
Oct 18, 2013 at 11:26pm UTC
AeonFlux1212
(125)
Thanks a lot, found a nice example in
http://www.cplusplus.com/reference/list/list/begin/
It's great, more efficient than <vector> in some cases...!
AeonFlux
Last edited on
Oct 18, 2013 at 11:29pm UTC
Topic archived. No new replies allowed.