C++ Deque cend()C++ Deque cend() function returns a constant iterator pointing to the past-the-last element. An iterator can be incremented or decremented but it cannot modify the content of a deque. If the container is empty then cend() function returns the same as cbegin() function. SyntaxParameterIt does not contain any parameter. Return valueIt returns a constant iterator referring to the past-the-last element in a deque. Example 1Let's see a simple example when deque containing character values. Output: j a v a T p o i n t In this example, cend() function is used to iterate throughout the deque container and the while loop executes until and unless 'itr' becomes equal to the ch.cend(). Example 2Let's see a simple example when deque contains integer values. Output: 100 200 300 400 500 In this example, cend() function is used to iterate throughout the deque container and the while loop executes until and unless 'itr' becomes equal to the ch.cend(). 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