I have 2 string vectors:
vector < string > animals = {"cat", "dog", "pig", "tiger", "monkey", "lion"}
vector < string > someAnimals = {"dog", "mouse", "snake", "monkey", "cat"}
How can I compare these 2 vectors and remove elements in someAnimals vector("mouse" and "snake") that aren't found in the animals Vector?
Aucun commentaire:
Enregistrer un commentaire