Javatpoint Logo
Javatpoint Logo

C++ Deque size()

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

For example:


where, return_type is an unsigned integral type.


It does not contain any parameter.

Return value

It returns the number of elements in the deque container.


Let's see a simple example


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

Help Others, Please Share

facebook twitter pinterest