Javatpoint Logo
Javatpoint Logo

C++ Deque empty()

C++ Deque empty() function checks whether the container is empty or not. If the container is empty, it returns 1 otherwise 0.

Syntax

Parameter

It does not contain any parameter.

Return value

It does not return any value.

Example 1

Let's see a simple example when deque is not empty.

Output:

Deque is not empty

In this example, empty() function determines that the deque is not empty. Therefore, it returns false.

Example 2

Let's see a simple example when deque is empty.

Output:

Deque is empty

In this example, empty() function determines that the deque is empty. Therefore, it returns true.


Next TopicC++ Deque



Please Share

facebook twitter google plus pinterest