

 Thread Tools  Search this Thread 
#1
 
 
The set_symmetric_difference() function of C++ I am interested in doing the programming. Thus, I had just started for learning the C++ programming language. I can also have the knowledge of the basic working of the functions. Hence, I want to know what is the set_symmetric_difference() function of the C++ language. I also want to know what is the use of the set_symmetric_difference() function in the C++ programming. Can anyone knows about the set_symmetric_difference() function of C++ language. 
#2
 
 
The set_symmetric_difference() The set_symmetric_difference() function of the C++ language can be used for the difference that can be symmetric of the two given specified ranges that can be sorted. The set_symmetric_difference() function can constructs a sorted range that can be starting in the place that can be pointed by the rslt with the set of difference that can be symmetric of the two given specified ranges such as the range [fst1,lst1) and the range [fst2,lst2) that can be sorted as content. The set_symmetric_difference() function can be comes under the algorithm header files. Last edited by Praetor : 05032010 at 03:44 PM. 
#3
 
 
The set_symmetric_difference() function of C++ The set_symmetric_difference() function of the C++ language can be used to create the symmetric difference between the two given ranges. The following can be the general form of the set_symmetric_difference() function in the C++ language : Code: template <class InptItrtr1, class InptItrtr2, class OtptItrtr> OtptItrtr set_symmetric_difference ( InptItrtr1 fst1, InptItrtr1 lst1, InptItrtr2 fst2, InptItrtr2 lst2, OtptItrtr rslt ); 
#4
 
 
set_symmetric_difference() The following program can demonstrates you how to implement the set_symmetric_difference() function of the C++ language in the C++ programming as follows : Code: #include <iostream> #include <algorithm> #include <vector> using namespace std; int main () { int ft[] = {5,10,15,20,25}; int sd[] = {50,40,30,20,10}; vector<int> v(10); vector<int>::iterator i; sort (ft,ft+5); sort (sd,sd+5); i=set_symmetric_difference (ft, ft+5, sd, sd+5, q.begin()); cout << "symmetric difference has " << int(i  q.begin()) << " elements.\n"; return 0; } Code: symmetric difference has 6 elements 
#5
 
 
The set_symmetric_difference() function of C++ The following can be the parameters of the set_symmetric_difference() function in the C++ language : 1. fst2, lst2 : These parameters of the set_symmetric_difference() function can contains an input iterators to the final and starting positions of the given second sequence. The range used can be as [fst2,lst2). 2. fst1, lst1 : These parameters of the set_symmetric_difference() function can contains input iterators to the final and starting positions of the given first sequence. The range used can be as [fst1,lst1) that can contains all of an elements that can be between fst1 and lst1. 
#6
 
 
Re: The set_symmetric_difference() function of C++ PROGRAM : Code: #include<algorithm> #include<set> #include <istream.h> using namespace std; int main() { int B1[] = {1,3,5,7,9,11}; int B3[] = {3,5,7,8}; set<int, less<int> > od(B1+0,B1+6), rslt, small(B3+0,B3+4); insert_iterator<set<int, less<int> > > res_ins(rslt, rslt.begin()); cout << "The symmetric difference of:" << endl << "{"; copy(small.begin(),small.end(), ostream_iterator<int,char>(cout," ")); cout << "} with {"; copy(od.begin(),od.end(), ostream_iterator<int,char>(cout," ")); cout << "} =" << endl << "{"; set_symmetric_difference(small.begin(), small.end(), od.begin(), od.end(), res_ins); copy(rslt.begin(),rslt.end(), ostream_iterator<int,char>(cout," ")); cout << "}" << endl << endl; return 0; } Code: The symmetric difference of: {3 5 7 8 } with {1 3 5 7 9 11 } = {1 8 9 11 } 

Tags: algorithm, cpp, functions, header files, set symmetric difference 
Thread Tools  Search this Thread 

Similar Threads for: "The set_symmetric_difference() function of C++"  
Thread  Thread Starter  Forum  Replies  Last Post 
c++ equivalent function to the cfunction 'sprintf  Dilbert  Software Development  6  13122011 04:03 PM 
c# function equivalent to gettime function in javascript  Omaar  Software Development  4  10032010 10:44 PM 
How to pass function with parameters to another function in PHP?  Linoo  Software Development  5  27022010 07:52 PM 
How does abstract function differs from virtual function?  Maddox G  Software Development  5  29012010 11:32 AM 
Function keys don't function under windows XP  GunFighter  Hardware Peripherals  3  08042009 11:07 PM 