#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
vector<char> vectorObject1, vectorObject2, vectorObject3(26);
int i;
for(i = 0; i <26; i+=2)
vectorObject1.push_back('A'+i);
for(i = 0; i <26; i+=2)
vectorObject2.push_back('B'+i);
cout << "Original contents of vectorObject1:";
for(i = 0; i <vectorObject1.size(); i++)
cout << vectorObject1[ i ];
cout << endl;
cout << "Original contents of vectorObject2:";
for(i = 0; i <vectorObject2.size(); i++)
cout << vectorObject2[ i ];
cout << endl;
merge(vectorObject1.begin(), vectorObject1.end(), // merge sequences
vectorObject2.begin(), vectorObject2.end(),
vectorObject3.begin());
cout << "Result of merge:\n";
for(i = 0; i <vectorObject3.size(); i++)
cout << vectorObject3[ i ];
return 0;
}
|