Program of Queue in C++
Follow is a program which uses built in function of queue in C++. This built in function make our work easy to use queues in C++.
#include <queue>
using namespace std;
int main()
{
queue <int> var;
var.push(1);
cout << var.front(); // print first value
cout << var.back(); // print last value
var.push(2);
var.pop(); // 1st value delete
int len = var.size();
}
there are a lot of other functions of Built-in Queue in C++.
-->

0 comments:
Post a Comment