fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4.  
  5. const char* getMessage1() {
  6. static std::string myString = "SomeOutput";
  7. return myString.c_str();
  8. }
  9.  
  10. int main() {
  11. printf("#1: %s \n", getMessage1()); // prints #1: SomeOutput
  12. return 0;
  13. }
  14.  
Success #stdin #stdout 0s 4196KB
stdin
Standard input is empty
stdout
#1: SomeOutput