Question: Hello, I want to return a reversed vector and noticed an issue when reversing it a certain way reverse(result.begin(),result.end()); return result; Why does returning it

Hello, I want to return a reversed vector and noticed an issue when reversing it a certain way

reverse(result.begin(),result.end());

return result;

Why does returning it like this work but this doesn't:

return reverse(result.begin(),result.end());

Why is that the case?

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!