given int a[]= {3,2,7,6,8,1,4,5}
vector<int> v(a,a+8)

use the stl copy algorithm to display the last 5 integers in the vector to cout with each integer on a seperate line.

copy takes three argument. third argument is output container. In this case it is v.but v already have 8 elemenst.
How to solve this pb?

This should give you a pretty good hint.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.