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
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- deque rend() function in C++ STL
- list rbegin() and rend() function in C++ STL
- multiset rbegin() and rend() function in C++ STL
- vector 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++
- How to call function within function in C or C++
- Difference between Virtual function and Pure virtual function in C++
- What happens when a virtual function is called inside a non-virtual function in C++
- div() function in C++
- log() function in C++
- exp() function C++
- fma() function in C++
- map key_comp() function in C++ STL
- wctob() function in C++
- wcscoll() function in C++
- isinf() function in C++
- Modulus function in C++ STL
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.