Welcome to collectivesolver - Programming & Software Q&A. A website you can trust. All programs tested and works. Contact: aviboots(AT)netvision.net.il
Hostgator 1 Penny

BlueHost Web Hosting

Ecommerce Software - Best Ecommerce Platform Made for You - Free Trial

Ecommerce Software - Best Ecommerce Platform Made for You - Free Trial

getflywheel wordpress hosting


Distribute your Resume to 500+ Job Boards & Recruiters


7,621 questions

10,674 answers

573 users

How to print set with for loop in C++

1 Answer

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

using std::cout;
using std::endl;
using std::string;
using std::set;

int main()
{
	set<string> st;

	st.insert("c++");
	st.insert("c");
	st.insert("java");
	st.insert("php");
	st.insert("python");

	typedef set<string>::const_iterator ci;
	for (ci it = st.begin(); it != st.end(); it++)
		cout << *it << " ";
	cout << endl;

	return 0;
}


/*
run:

c c++ java php python

*/

 




answered Apr 23 by avibootz
...