Javatpoint Logo
Javatpoint Logo

C++ priority_queue size()

C++ priority_queue size() function is used to get size of the priority queue container. It returns size in an integer value.

Syntax

Consider priority_queue 'pq' as a priority_queue object.

Parameter

It does not take any parameter.

Return value

It returns the size of the priority queue.

Example 1

Output:

5

Example 2

Output:

20
Next TopicC++ priority_queue



Please Share

facebook twitter google plus pinterest