fork download
  1. #include <iostream>
  2.  
  3. std::string x[] = {"X", "O", "X", "O"};
  4.  
  5. int main()
  6. {
  7. std::cout << "Before: " << x[0] + x[1] + x[2] + x[3] << std::endl;
  8. for (int i = 0; i < 4; i++)
  9. {
  10. x[i] = std::to_string(i);
  11. }
  12. std::cout << "after: " << x[0] + x[1] + x[2] + x[3] << std::endl;
  13. return 0;
  14. }
Success #stdin #stdout 0s 5348KB
stdin
Standard input is empty
stdout
Before: XOXO
after: 0123