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

前端 未结 5 1204
广开言路
广开言路 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条回答
  •  萌比男神i
    2020-12-24 06:14

    std::map and std::set are extremely similar. They both have a sorted collection of unique keys. Additionally, map has a value associated with each key.

提交回复
热议问题