C++ Deque back()

C++ Deque back() function is used to access the last element of the deque container.

Syntax

Parameter

It does not contain any parameter.

Return value

It returns a reference to the last element of the deque container.

Example 1

Let's see a simple example

Output:

5

In this example, back() function returns the last element of the deque i.e 5.

Example 2

Let's see a another simple example

Output:

Content of deque:15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 

Next TopicC++ Deque



Latest Courses