- #1
FrostScYthe
- 80
- 0
Hi, I've been having trouble erasing elements from a <vector> (that is from the STL of C++)
See I declared 2 vectors V and S, V contains let's say all the elements, while S is a solution set which contains some elements that are classified... well yeah...
I need to create V-S which is a vector that has all the elements in V that are not in S.. I was planning on doing this by making a copy of V into V_S and then erasing every element I add to S from V_S.
sort of like this:
S.push_back(x);
V_S.erase(x);
I get an error... Why?
See I declared 2 vectors V and S, V contains let's say all the elements, while S is a solution set which contains some elements that are classified... well yeah...
I need to create V-S which is a vector that has all the elements in V that are not in S.. I was planning on doing this by making a copy of V into V_S and then erasing every element I add to S from V_S.
sort of like this:
S.push_back(x);
V_S.erase(x);
I get an error... Why?