C++ implementation of queue using array I have written this code after studying from Introduction to Algorithm. I think this code is very basic and simple. I want to modify it.

#include &lt;iostream&gt;
int tail;
int head;

void initialise_head_tail(){
tail=0;
head=0;
}

void enqueue(int a[],int x,int s){
a[tail]=x;
if( tail+1==s)
    tail=0;
else
    tail++;
}

int dequeue(int a[],int s){
int x=a[head];
if(head+1==s)
    head=0;
else
    head++;
return x;
}
int main()
{
    initialise_head_tail();
    int a[5];
    enqueue(a,15,5);
    enqueue(a,6,5);
    enqueue(a,9,5);
    enqueue(a,8,5);
    enqueue(a,4,5);
    for(int i=0;i&lt;5;i++){
        std::cout&lt;&lt;a[i]&lt;&lt;" ";
    }
    std::cout&lt;&lt;"\n"&lt;&lt;dequeue(a,5);
    return 0;
}


I want to learn if I can apply some better logic. I was thinking to use vector instead of array but there are already methods push_back() and pop_back(). Can we use vector?
Distributing the internal state of your queue over some globals and two arguments is an interesting decision. At least that way you can get the worst of all worlds.
enqueue assumes the queue is not full, dequeue assumes it is not empty. That's also a questionable decision.
You know that streaming a char is more efficient than streaming a length-1-string?
return 0; is implicit for main() in C++ and C99+.
I wonder why you wrap a conditional statement into its own block exactly one time. Some advocate using a block everywhere, others only where needed, but both camps are united in wanting consistency.
The inside of your first three functions somehow lost a level of indentation... and there should be a newline before main().