Question: This is a C++ question. 1. Define a global vector gv; initialize it with ten ints 1,2,4,8,16 etc. 2. Define a function f() takjing a

This is a C++ question.

1. Define a global vector gv; initialize it with ten ints 1,2,4,8,16 etc.

2. Define a function f() takjing a vector arguement

3. In f():

a) Define a local vector lv with the same number of elements as the arguent vector

b) Copy the values from gv into lv

c) Print out the elements of lv

d) Define a local vector lv2; initialize it to be a copy of the argument vector

e) Print out the elements of lv2

4. in main()

a) call f() with gv as its argument

b) Define a vector vv and initialize it with the first ten factorial values (1, 2*1, 3*2*1, etc)

c) call f() with vv as argument

I dont understand how to solve this

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!