What is the difference between set vs map in C++?

前端 未结 5 1212
广开言路
广开言路 2020-12-24 06:06

I am still confused by the differences between the map and set datastructures in STL. I know set is storing the values in a sorted way, what about map? Does it store the val

5条回答
  •  无人及你
    2020-12-24 06:19

    std::map is an associative container storing pairs of key-values with unique keys. std::set is also an associative container that stores a sorter set of objects (or keys).

    You should have a look at std::map and std::set.

提交回复
热议问题