Write a statement declares and stores the elements


Discuss the below:

Q1. Write a statement that declares and stores the elements of the following array into a vector object:

char vowels[5] = {'a', 'e', 'i', 'o', 'u'};

Q2. What is the output of the following program segment? (Assume that screen is an ostream iterator initialized to the standard output device to output elements of the type int.)

int list[5] = {2, 4, 6, 8, 10};
vector vecList(5);

copy(list, list + 5, vecList.begin());

copy(vecList.begin(), vecList.begin());

copy(vecList.begin(), vecList.end(), screen);
cout<

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: Write a statement declares and stores the elements
Reference No:- TGS01937831

Now Priced at $20 (50% Discount)

Recommended (99%)

Rated (4.3/5)