Question: what is the difference between vector and map in c++?
Answer: A vector stores the data in an internal array that it resizes and you add more elements. An unordered_map uses a hash table internally. ... Nope, indexes in a vector are continuous, in a map they don't have to be. Also, values in a vector are guaranteed to be in continuous memory, not in a map .