I need to sort a queue. So far I have created a queue containing 4 numbers, I then put these numbers into 4 variables (w, x, y and z). I was then going to put these variables into an array and sort the array. But I cant figure out how to put the contents of w, x, y and z into the array. Any suggestions.

q.push(1);
cout<<"the firt number in the queue is: "<<q.front()<<endl;
q.push(0);
cout<<"the second number in the queue is: "<<q.back()<<endl;
q.push(3);
cout<<"the thrid number in the queue is: "<<q.back()<<endl;
q.push(2);
cout<<"the fourth number in the queue is: "<<q.back()<<endl<<endl;

//put items into variable
w=q.front();
q.pop();
x=q.front();
q.pop();
y=q.front();
q.pop();
z=q.front();