fork download
  1. #include <iostream>
  2. #include <string>
  3. #include <vector>
  4. #include <functional>
  5. using namespace std;
  6.  
  7.  
  8. struct Foo{
  9. string these, are, some, naughty, fields;
  10. };
  11.  
  12. int main() {
  13. Foo foo;
  14. vector<reference_wrapper<string>> v = {
  15. foo.these, foo.are, foo.some, foo.naughty, foo.fields
  16. };
  17. for(auto &e : v)
  18. getline(cin, e.get());
  19.  
  20. cout << foo.these << foo.are << foo.some << foo.naughty << foo.fields << endl;
  21. return 0;
  22. }
Success #stdin #stdout 0s 3280KB
stdin
These
are
some
NAUGHTY
fields
stdout
ThesearesomeNAUGHTYfields