Question: use c++ screen shot the code and result, provide some explantions as well ty. Q1. Write a function called reverse. It takes as a parameter

use c++ screen shot the code and result, provide some explantions asuse c++ screen shot the code and result, provide some explantions as well ty.

Q1. Write a function called reverse. It takes as a parameter a vector of int It returns a reference to a vector of int The function should: 1. invert the input vector 2. return a reference to the input vector Example std::vector vec {1,2,3); auto ret = reverse(vec); After this code, vec should contain (3,2,1) and ret should be a reference to a vector of int with values (3,2,1) There are no restrictions on how you can implement this function, but it should work with a vector of any size

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!