I need to remove the elements that appear in Vector A and Vector B, but keep the elements that are only in Vector A. The vectors can be of any size, but are not necessarily equal to each other.
For example, if:
vector A contains the values <1,4,66,22>
vector B contains the values <1,22,44,93,102,543>
Then after preforming the operation:
vector A should contain <4,66>
vector B should contain <44,93,102,543>
Do I need to loop through both with a for loop and strncmp the values or is the a function that I can use to streamline the process?
The set_intersection shows its possible implementation. You could build from that code a function that takes two sorted ranges and returns two ranges: uniques of each input range.
PS. std::string has operator== so strncmp() is not necessary.