.size()

The .size() method returns the number of elements in the queue.

Syntax

The .size() method is called on a queue using the following syntax:

queueName.size();

Codebyte Example

The codebyte example below uses the .size() method on the pizzas queue:

Code
Output
Loading...

Contributors

Interested in helping build Docs? Read the Contribution Guide or share your thoughts in this feedback form.

Learn C++ on Codecademy