Javatpoint Logo
Javatpoint Logo

C++ List size()

C++ List size() function finds the number of elements present in the list. This function does not modify the content of a deque.

Syntax

Parameter

It does not contain any parameter.

Return value

It returns the number of elements in the list.

Example

Let's see a simple example

Output:

size of the list is: 3

In this example, size() function returns the size of the list i.e 3.


Help Others, Please Share

facebook twitter pinterest