# set_union, set_difference, set_symmetric_difference, set_intersection : Vector Utility « Data Structure « C++

Home
C++
 1 Bitset 2 Class 3 Console 4 Data Structure 5 Data Type 6 Deque 7 Development 8 File 9 Function 10 Generic 11 Language 12 List 13 Map Multimap 14 Overload 15 Pointer 16 Qt 17 Queue Stack 18 Set Multiset 19 STL Algorithms Binary search 20 STL Algorithms Heap 21 STL Algorithms Helper 22 STL Algorithms Iterator 23 STL Algorithms Merge 24 STL Algorithms Min Max 25 STL Algorithms Modifying sequence operations 26 STL Algorithms Non modifying sequence operations 27 STL Algorithms Sorting 28 STL Basics 29 String 30 Valarray 31 Vector
 C++ » Data Structure » Vector Utility Screenshots
set_union, set_difference, set_symmetric_difference, set_intersection
 ``` #include  #include  #include  using namespace std; int main() {   vector vectorObject1, vectorObject2, v_res(26), vectorObject3;   vector::iterator p, pres_end;   int i;   for(i = 0; i <20; i++)        vectorObject1.push_back('A'+i);   for(i=10; i <26; i++)        vectorObject2.push_back('A'+i);   cout << "Contents of vectorObject1:\n";   for(i = 0; i
Related examples in the same category
 1 Demonstrate inner_product() in vector 2 Demonstrate partial_sum() in vector 3 Use a unary function object to determine even/odd. 4 Demonstrate count_if and not1 in vector 5 Another way to sort a sequence into descending order. 6 Use a function adaptor in vector 7 Demonstrate insert_iterator in a vector 8 Insert one vector into another using an insert iterator 9 Demonstrate back_insert_iterator in vector 10 Demonstrate front_insert_iterator in vector 11 Find minimum and maximum inside a vector 12 Use for_each() in vector 13 Use the logical_not unary function object in vector 14 Sorting a vector into descending order in vector 15 Using copy() in Vector 16 Using swap_ranges() in Vector 17 Exchange elements from two different types of containers. 18 Demonstrate find() and find_if() in vector 19 Demonstrate search() in vector 20 Demonstrate mismatch() in vector 21 Demonstrating sort() in vector 22 Demonstrating partial_sort() in vector 23 Demonstrate binary_search() in vector 24 Demonstrate lower_bound() in vector 25 Demonstrating remove() and replace() in vector 26 Demonstrating unique() in vector 27 Transforming a sequence in vector 28 Generating a sequence in vector 29 Rotate a sequence in vector 30 Right-rotate a sequence in vector 31 Demonstrate random_shuffle() in vector 32 Merge two sequences 33 A vector may allocate more memory than it currently needs.