#include<iostream>
usingnamespace std;
constint MAXQUEUE = 20;
struct myqueue{
int items[MAXQUEUE];
int front, rear;
};
int empty(myqueue *pq){
pq->front=0;
pq->rear=-1;
}/*empty queue*/
int destroy(myqueue *pq,int x){
if (pq->front>pq->rear){
cout << "queue underflow" << endl;
exit(1);
}/* end if */
else
{
pq->items[pq->front]=x;
(pq->front)++;
}
}/* end dequeue */
int insert(struct myqueue *pq, int x){
/*make room for new element*/
if (pq->rear == MAXQUEUE-1)
cout << "queue overflow" << endl;
/* check for overflow */
else{
(pq->rear)++;
pq->items[pq->rear] = x;
return 0;
}
}/* end enqueue*/
int main(){
int place;
myqueue queue;
empty(&queue);
place=10; //place is value to put into the queue
insert(&queue,place);
cout<<queue.items[queue.rear];
cin>>place;
return 0;
}