#include <iostream>
#include <vector>
#include <string>
//#include <algorithm>
using namespace std;
int main()
{
string str[] = {"Alex", "John", "Robert"};
vector<int> v1; //empty vector object
vector<int> v2(10); //creates vector with 10 elements
vector<int> v3(10, 0); //create vector with 10 elements, and assign value 0 for eatch
vector<string> v4(str + 0, str + 3);//create vector and assigns values from string array
//把str的第0个元素开始到 第3个元素复制进 v4中。
vector<string>::iterator sit = v4.begin();
while(sit != v4.end())
cout<<*sit++<<" ";
cout<<endl;
vector<string> v5(v4); //copy constructor
for(int i = 0; i < 3; i++)
cout<<v5[i]<<" ";
cout<<endl;
//cout<<v4.size()<<endl; 3
return 0;
}