C++ Deque rbegin()C++ Deque rbegin() function returns a reverse iterator pointing to the last element of the container. An iterator can be incremented or decremented but it cannot modify the content of deque. Where, rbegin() stands for reverse beginning. Note: Reverse iterators are those which iterate from backwards and move towards the beginning of the deque.SyntaxParameterIt does not contain any parameter. Return valueIt returns a reverse iterator referring to the last element of a deque. Example 1Let's see a simple example Output: 5 4 3 2 1 In this example, rbegin() function reverses the content of deque by iterating from backwards and moving towards the beginning of the container. Example 2Let's see a simple example when reverse iterator is incremented by one. Output: C In this example, reverse iterator is incremented by one. Therefore, rbegin() function access the second element from backwards. Next TopicC++ Deque |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India