Valid CPP Dumps shared by ExamDiscuss.com for Helping Passing CPP Exam! ExamDiscuss.com now offer the newest CPP exam dumps, the ExamDiscuss.com CPP exam questions have been updated and answers have been corrected get the newest ExamDiscuss.com CPP dumps with Test Engine here:
What will happen when you attempt to compile and run the code below, assuming that you enter the following sequence: 1 2 3 4 quit<enter>? #include <iostream> #include <string> #include <list> #include <algorithm> using namespace std; template<class T>struct Out { ostream & out; Out(ostream & o): out(o){} void operator() (const T & val ) {out<<val<<" "; } }; int main () { list<string> l; while(cin.good()) { string s; cin>>s; if (s == "quit") break; l.push_back(s); } for_each(l.begin(), l.end(), Out<string>(cout)); return 0; } Program will output: