How to assign deque to another in C++

1 Answer

0 votes
#include <iostream>
#include <deque>
#include <string>

using std::cout;
using std::endl;
using std::deque;
using std::string;

int main()
{
	deque<string> dq1{ "c", "c++", "java", "php" }, dq2;

	dq2 = dq1;

	for (string val : dq2)
		cout << val << " ";

	cout << endl;

	return 0;
}

/*
run:

c c++ java php

*/

 



answered May 4, 2018 by avibootz

Related questions

1 answer 221 views
1 answer 206 views
1 answer 183 views
1 answer 79 views
1 answer 126 views
...