C++ Deque size()

C++ Deque size() function determines the number of elements present in the deque container.

For example:

Syntax

where, return_type is an unsigned integral type.

Parameter

It does not contain any parameter.

Return value

It returns the number of elements in the deque container.

Example

Let's see a simple example

Output:

size of deque is :0
size of deque is :3

In this example, when deque 'd' is empty then the size() function returns 0. When three elements are added in the deque container then size() function returns 3.


Next TopicC++ Deque