Javatpoint Logo
Javatpoint Logo

C++ emplace_back()

C++ Deque emplace_back() function adds a new element at the end of the deque and the size of the container is increased by one.

Syntax

Parameter

val: New value to be inserted at the end of the deque.

Return value

It does not return any value.

Example 1

Let's see a simple example

Output:

1 2 3 4 5

In this example, emplace_back() function adds a new element i.e 5 at the end of the deque.

Example 2

Let's see a simple example

Output:

java

In this example, emplace_back() function adds a new element i.e 'a' at the end of the deque.


Next TopicC++ Deque



Help Others, Please Share

facebook twitter pinterest