#include<iostream>
#include<deque>
usingnamespace std;
int main()
{
//declare a deque named deq to hold characters
deque<char> deq ;
//using push_back, add the characters a, b andd c to the back of the deque
deq.push_back("a");
deq.push_back("b");
deq.push_back("c");
cout << "Contents of deque after adding a-c to the back..." << endl;
for(int i=0; i<deq.size(); i++)
cout << deq[i] << " " ;
cout << endl;
//using push_front, add the characters x, y and z to the front of the deque
deq.push_front("x");
deq.push_front("y");
deq.push_front("z");
cout << "\nContents of deque after adding x-z to the front..." << endl;
for(int i=0; i<deq.size(); i++)
cout << deq[i] << " " ;
cout << endl;
//display and then remove the value at the front of the deque
cout << deq.front();
deq.pop_front;
//display and then remove the value at the rear of the deque
cout << deq.back();
deq.pop_back;
return 0;
}
I am unsure of why I keep getting an error under neath the the periods when I try and push a value to a deque. Any help would be great thank you.