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.


Please Share

facebook twitter google plus pinterest