Check out example codes for "built in queue c++". It will help you in understanding the concepts better.

Code Example 1

#include<iostream>
#include<queue>
using namespace std;
void showq(queue <int> gq)
{
    queue <int> g = gq;
    while (!g.empty())
    {
        cout << ' ' << g.front();
        g.pop();
    }
    cout << '\n';
}
int main()
{
    queue<int> gquiz;
    gquiz.push(10);
    gquiz.push(20);
    gquiz.push(30);
 	cout << "Front Element: ";
    cout << gquiz.front();
  
    cout << "\nThe queue gquiz is:";
    showq(gquiz);
}

Learn ReactJs, React Native from akashmittal.com