fork download
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. int main() {
  6. string s1 = "aleph";
  7. string s2 = "alpha";
  8. string s;
  9. s1.swap(s2);
  10. s2.swap(s);
  11. s.swap(s2);
  12. cout << s2;
  13. return 0;
  14. }
  15.  
  16.  
Success #stdin #stdout 0.01s 5292KB
stdin
Standard input is empty
stdout
aleph