fork download
  1. #include <iostream>
  2. #include <string>
  3.  
  4. std::string f()
  5. {
  6. std::string s = "s";
  7. std::cout << &s << '\n';
  8. return s;
  9. }
  10.  
  11. int main()
  12. {
  13. std::string s = f();
  14. std::cout << &s << '\n';
  15. }
Success #stdin #stdout 0s 4396KB
stdin
Standard input is empty
stdout
0x7ffd483d28c0
0x7ffd483d28c0