vico
vico

Reputation: 18171

array of not duplicated elements

I need to have array of elements that are not duplicated. That means if element is in the list then new value will be skipped from array. Are there any standard types that might be useful in this case (vector, map, etc...)?

Upvotes: 0

Views: 57

Answers (2)

sleepsort
sleepsort

Reputation: 1331

You can use set to avoid duplicates.

Upvotes: 1

RonaldBarzell
RonaldBarzell

Reputation: 3830

Hash tables can do this. You have some choices, both standard and MS specific.

Take a look at std::map for a start:

http://www.cplusplus.com/reference/map/map/

Upvotes: 0

Related Questions