I'm trying to look at 2 vectors of strings, we'll call them A and B. For each element in B, I want to check if that element is also in A. If that element is not in A, I want to insert it into an empty third vector called C.
This is what I have so far:
1 2 3 4 5 6 7
for(int i=0; i<B.size(); i++){
std::vector<string>::iterator it;
it = std::find(A.begin(), A.end(), B[i]);
if (it == A.end()){
C.push_back(B[i]);
}
}
I'm getting an error about a non-matching function call for the C.push_back() call. Can anyone see what I am doing wrong?