C++ STL set functions... and liquids that can write code
Are you badass with C++ STL? Then fix this... #include <iostream> #include <map> #include <set> #include <algorithm> #include <ostream> #include <iterator> using namespace std; int main() { map<const char, int> A; A['a'] = 0; A['b'] = 5; A['c'] = 10; map<const char, int> B; B['b'] = 105; B['c'] = 110; B['d'] = 115; map<const char, int> C; set_difference(A.begin(), A.end(), B.begin(), B.end(), less<char>, inserter(C, C.begin()) ); /*cout << "Set C (difference of A and B): "; copy(C.begin(), C.end(), ostream_iterator<const char*>(cout, " ")); cout << endl;*/ } ================= <aeacides> lol <aeacides> fulld: you reversed the order of the comparison functor with the insert iterator <aeacides> set_difference(A.begin(), A.end(), B.begin(), B.end(), inserter(C, C.begin()), ltpairchar());...