setdiff0.cpp
setdiff0.cpp
#include ‹stl.h›
#include ‹iostream.h›
int v1[3] = {13, 18, 23};
int v2[4] = {10, 13, 17, 23};
int result[4] = {0, 0, 0, 0};
int main() {
set_difference(v1, v1 + 3, v2, v2 + 4, result);
for (int i = 0; i ‹ 4; i++) cout ‹‹ result[i] ‹‹ ;
cout ‹‹ endl;
set_difference(v2, v2 + 4, v1, v1 + 2, result);
for (i = 0; i ‹ 4; i++) cout ‹‹ result[i] ‹‹ ;
cout ‹‹ endl;
return 0;
}