deque - STL C++

deque<X, A>::begin()

Declaration

const_iterator deque<X,A>::begin() const;

Description

This is the begin() function for the deque class template.

Header Include

#include <deque>

Overloads

iterator deque<X,A>::begin();

Example

#include <iostream>
#include <deque>

int main()
{
	using namespace std;

	// Create a deque instance
	deque<char> qD;
	qD.push_back('X');
	qD.push_back('o');
	qD.push_back('a');
	qD.push_back('X');
	qD.push_back('.');
	qD.push_back('n');
	qD.push_back('e');
	qD.push_back('t');

	// Use begin() to initialize the iterator
	deque<char>::iterator qIter;
	for (qIter = qD.begin(); qIter != qD.end(); ++qIter) {
		cout << *qIter;
	}
	cout << endl;

	// Keep the window open
	cin.get();
	return 0;
}

Output

deque<X, A>::begin() Output
 

© 2007–2024 XoaX.net LLC. All rights reserved.