Are lists contiguous in memory?

Jul 6, 2014 at 8:04pm
Fairly simple question. Are the elements in list placed in sequential memory addresses like vectors, or are they not placed in order in memory and can only tell position thanks to pointers pointing to the next position?

Thanks in advance!
Jul 6, 2014 at 8:52pm
http://www.cplusplus.com/reference/list/list/
... lists can store each of the elements they contain in different and unrelated storage locations ...
Jul 6, 2014 at 9:37pm
std::vector, however, does store elements contiguously in memory. It's also almost always preferred over std::list (which is only useful in special cases)
Topic archived. No new replies allowed.