fork download
  1. #include <cstdlib>
  2. #include <iostream>
  3. #include <string>
  4.  
  5. using namespace std;
  6.  
  7. // function declaration
  8. string hi();
  9.  
  10. int main(int argc, char** argv) {
  11. // call method
  12. string string_hi;
  13. string_hi = hi();
  14. cout << string_hi << endl;
  15. }
  16.  
  17. string hi() {
  18. //simple string function
  19. return "Hello World";
  20. }
Success #stdin #stdout 0s 3468KB
stdin
Standard input is empty
stdout
Hello World