STL Container

Which STL container is most appropriate to store telephone records?
what do you want to do with those records?
Display the contents (a list of telephone nos) of the container.
I would suggest an std::set. A set ensures that there are no duplicates (it's like a map, except its elements are the keys), and there's even some weak sorting done. There's no push_back(), but there is still insert().
http://cplusplus.com/reference/stl/set/

-Albatross
Last edited on
Topic archived. No new replies allowed.