The rend() function is an inbuilt function in C++ STL which returns a reverse iterator pointing to the theoretical element right before the first key-value pair in the map(which is considered its reverse end).
Parameters:The function does not take any parameter.
Return Value: The function returns a reverse iterator pointing to the theoretical element right before the first element in the map.
Note: Reverse iterators iterate backwards i.e when they are increased they move towards the beginning of the container.
The following programs illustrates the function.
c = 5 b = 3 a = 1
a = 1
- deque rend() function in C++ STL
- vector rbegin() and rend() function in C++ STL
- multiset rbegin() and rend() function in C++ STL
- list rbegin() and rend() function in C++ STL
- multimap rend in C++ STL
- set::rbegin() and set::rend() in C++ STL
- array::rbegin() and array::rend() in C++ STL
- Function Overloading vs Function Overriding in C++
- What happens when a virtual function is called inside a non-virtual function in C++
- exp() function C++
- log() function in C++
- div() function in C++
- fma() function in C++
- wcsncpy() function in C++ with example
- imag() function in C++
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.