fork(18) download
  1. #include <iostream>
  2. #include <string>
  3. #include <cassert>
  4. #include <thread>
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9. std::string orig = "abc";
  10. std::string copy = orig;
  11. std::cout << (void*) orig.data() << ", " << (void*) copy.data() << endl;
  12. assert(orig.data() == copy.data());
  13. }
  14.  
Success #stdin #stdout 0s 3016KB
stdin
Standard input is empty
stdout
0x8810014, 0x8810014