fork download
  1. #include <iostream>
  2. #include <vector>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. std::vector< std::string > slist { "a", "b", "c" };
  8. slist[ 1 ] = "Changed!";
  9.  
  10. for ( const auto& i : slist )
  11. {
  12. cout << i << ' ';
  13. }
  14.  
  15. return 0;
  16. }
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
a Changed! c