C++ Deque rend()C++ Deque rend() function returns a reverse iterator referring to the element preceding the first element in the deque container. An iterator can be incremented or decremented just like end() function. Where, rend() stands for reverse end. ![]() SyntaxParameterIt does not contain any parameter. Return valueIt returns a reverse iterator pointing to the reverse end of the deque container. Example 1Let's see a simple example Output: lairotuT In this example, reverse iterator is used to iterate from backwards and it iterates until and unless it becomes equal to the c.rend().It prints the reverse content of a deque c i.e lairotuT Example 2Let's see a simple example when reverse iterator is decremented by 2. Output: 2 In this example, reverse iterator is decremented by 2. Therefore, it access the second element of deque.
Next TopicC++ Deque
|