fork(2) download
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. typedef void (*fptr)(string);
  6.  
  7. void f(string s) {
  8. cout << "Hello " << s << endl;
  9. }
  10.  
  11. int main() {
  12. void *vp = reinterpret_cast<void*>(f);
  13. reinterpret_cast<fptr>(vp)("world");
  14. return 0;
  15. }
Success #stdin #stdout 0s 3428KB
stdin
Standard input is empty
stdout
Hello world