Need help with Deques

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51

#include<iostream>
#include<deque>


using namespace 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.
use single quotes for chars. deq.push_back('a');
Oh wow.... Thank you sir. Probably shouldve came here first before staring at the screen for 45 minutes.
Staring builds character :P pun intended.
Topic archived. No new replies allowed.