.size()

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

Looking to contribute?

Learn C++ on Codecademy