.size()

Christine_Yang's avatar
Published May 23, 2022Updated Dec 21, 2022
Contribute to Docs

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...

All contributors

Contribute to Docs

Learn C++ on Codecademy