I have two vectors but and i want to search both vectors to make sure there are no duplicate items in the vectors. Do i do this the same way i would search a 2d array? for row for coloumn?
You might want to look into a set rather than a vector, sets are made to only hold unique items. http://www.cplusplus.com/reference/set/set/ (also look into the unordered set since it's technically faster)
However, for the vector you actually have to use a nested for loop to make sure that you check each element of the first vector against each element of the second one.
It sounds like i may need a set if they can be used as vectors.
Let me clarify what I'm trying to do. I'm writing a card game and i want to test to see if any of the vectors have the same card once the deck has been shuffled and passed to the number of players. So if there are two players i want to make sure they dont have any same card and same with three players (compare three vectors or sets) and the same with four players.
Hope that cleared it up! I can supply the code i have but i dont think it will help too much since i havent written any code for this portion.