fork(2) download
  1. #include <iostream>
  2.  
  3. #include <string>
  4.  
  5. #include <iomanip>
  6.  
  7. #include <map>
  8.  
  9.  
  10.  
  11. int main()
  12.  
  13. {
  14.  
  15. std::map<std::string, std::string> m;
  16.  
  17. m["hello there"] = "greeting";
  18.  
  19. m["where are you?"] = "question";
  20.  
  21.  
  22.  
  23. std::cout << std::left;
  24.  
  25.  
  26.  
  27. for (std::map<std::string, std::string>::iterator i = m.begin();
  28.  
  29. i != m.end();
  30.  
  31. i++)
  32.  
  33. {
  34.  
  35. std::cout << std::setw(16)
  36.  
  37. << std::string("\"" + i->first + "\"")
  38.  
  39. << " => "
  40.  
  41. << i->second
  42.  
  43. << "\n";
  44.  
  45. }
  46.  
  47. return 0;
  48.  
  49. }
  50.  
  51.  
Success #stdin #stdout 0.02s 2820KB
stdin
Standard input is empty
stdout
"hello there"    => greeting
"where are you?" => question