fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. std::string foo() {
  5. std::string test = "abc";
  6.  
  7. return test.c_str();
  8. }
  9.  
  10. int main() {
  11. std::string str = foo();
  12. std::cout << str << std::endl;
  13.  
  14. return 0;
  15. }
Success #stdin #stdout 0s 3468KB
stdin
Standard input is empty
stdout
abc