fork(1) 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 hi;
  13. hi = ::hi();
  14. cout << 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