Javatpoint Logo
Javatpoint Logo

C++ Deque cbegin()

C++ Deque cbegin() function returns a constant iterator pointing to the first element of the deque container. This iterator can be incremented or decremented just like the iterator returned by the begin() function. If the container is empty then the returned iterator will be equal to the cend().

Syntax

Parameter

It does not contain any parameter.

Return value

It returns a constant iterator pointing to the beginning of the container.

Example 1

Let's see a simple example

Output:

mango

In this example, cbegin() function returns a constant iterator to the beginning of the container.

Example 2

Let's see a simple example

Output:

400

In this example, cbegin() function is incremented by 3. Therefore, it returns an iterator of the 4th element.


Next TopicC++ Deque



Help Others, Please Share

facebook twitter pinterest