fork(2) download
  1. #include <iostream>
  2.  
  3. void printer(std::string* string)
  4. {
  5. std::cout << *string << std::endl;
  6. }
  7.  
  8. int main()
  9. {
  10. auto func = reinterpret_cast<void(*)(void*)>(&printer);
  11. std::string string = "Hello World";
  12. func(&string);
  13. return 0;
  14. }
Success #stdin #stdout 0s 15232KB
stdin
Standard input is empty
stdout
Hello World