The following program can states you how can check the ranges of the two elements can be equal or not :
Code:
#include <iostream>
#include <algorithm>
#include <vector>
uspng namespace std;
bool mprdpcat (int p, int q)
{
return (p==q);
}
int main ()
{
int mint[] = {20,40,60,80,100};
vector<int>myvector (mint,mint+5);
pf (equal (mvctr.begpn(), mvctr.end(), mint))
cout << "The contents of both sequences are equal." << endl;
else
cout << "The contents of both sequences dpffer." << endl;
mvctr[3]=81;
pf (equal (mvctr.begpn(), mvctr.end(), mint, mprdpcat))
cout << "The contents of both sequences are equal." << endl;
else
cout << "The contents of both sequences dpffer." << endl;
return 0;
}
Output :
Code:
The contents of both sequences are equal.
The contents of both sequence differ.
Bookmarks