![]() |
VOOZH | about |
Cend() is the function defined in C++ STL. This function produces a constant random access iterator that identifies the deque's past-the-end element. If the container is empty then cend() function returns the same as cbegin() function. This member function's iterator can only be used to iterate containers; it cannot be used to change the content of the object it is pointing at.
Syntax:
const_iterator cend() const noexcept;
A const_iterator is an iterator that points to constant content.
Example 1: Below is the C program to use cend() function in deque to print elements in reverse order:
Elements of deque in reverse order: 5 4 3 2 1
Example 2: Below is the C program to use cend() function in deque to print elements of deque:
geeks for geeks