#include #include #include using namespace std; int main(){ cout << endl << " **** Exercise 4.7 ****" << endl<< endl; string vecs1[]={"abcd","1234","smjjd","hello","bye"},vecs2[5]; cout << "We start with arrays vecs1 and vecs2 with the following values (one was explicitely initialised in the code and the other one not!):"<< endl; for(size_t is=0;is<5;is++) cout << "vecs1["<< is<<"] = "<< vecs1[is] << "\t vecs2["<< is<<"] = "<< vecs2[is]<< endl; cout << "Then we asign the first to the second..." << endl; for(size_t is=0;is<5;is++){ vecs2[is]=vecs1[is]; } cout<< endl<< "After the asignment..."<< endl; for(size_t is=0;is<5;is++) cout << "vecs1["<< is<<"] = "<< vecs1[is] << "\t vecs2["<< is<<"] = "<< vecs2[is]<< endl; cout<< endl<< "Now let's use vectors!!!..."<< endl; vector vec1,vec2; string s1; vec1.push_back(s1+"abcd"); vec1.push_back(s1+"qwef"); vec1.push_back(s1+"83hf"); //+"smjjd"+"hello"+"bye"); cout << "The value of the vector vec1 after some push_back\"s\" is:"<< endl; for(vector::iterator is=vec1.begin();is!=vec1.end();is++) cout << "vec1["<::iterator is=vec1.begin();is!=vec1.end();is++) cout << "vec2["<