Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Latest commit

 

History

History
19 lines (15 loc) · 441 Bytes

size.md

File metadata and controls

19 lines (15 loc) · 441 Bytes

size

Description : size() function is used to return the size of the queue or the number of elements in the queue.

Example:

    std::queue<int> myqueue;
    myqueue.push(4);
    myqueue.push(5);
    myqueue.push(9);
    myqueue.push(1);
    myqueue.push(3);
    
    // Queue becomes 4, 5, 9, 1, 3
    
    // Print the size of myqueue
    std::cout << myqueue.size();

Run Code