list container question

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
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/
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
Topic archived. No new replies allowed.