The list::reverse() is a built-in function in C++ STL which is used to reverse a list container. It reverses the order of elements in the list container.
Parameters: This function does not accept any parameters.
Return Value: This function does not return any value. It just reverses the order of elements in the list container with which it is used.
Below program illustrate the list::reverse() function in C++ STL:
Initial List: 10 20 30 40 List after reversing: 40 30 20 10
Rated as one of the most sought after skills in the industry, own the basics of coding with our C++ STL Course and master the very concepts by intense problem-solving.