Purchase Solution

declare and store elements of array into vector object

Not what you're looking for?

Ask Custom Question

4. 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'};

8. 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<int> vecList(5);

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

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

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

Purchase this Solution

Solution Summary

It is comprised of codes on how to declae and store the elements of the following array into a vector object. It further explains the output of the program segment.

Purchase this Solution


Free BrainMass Quizzes
Word 2010: Tables

Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.

Basic UNIX commands

Use this quiz to check your knowledge of a few common UNIX commands. The quiz covers some of the most essential UNIX commands and their basic usage. If you can pass this quiz then you are clearly on your way to becoming an effective UNIX command line user.

Javscript Basics

Quiz on basics of javascript programming language.

Java loops

This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.

Word 2010: Table of Contents

Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.