fork download
  1. #include <iostream>
  2.  
  3. void target(const std::string& str)
  4. {
  5. std::cout << "fn " << str << "\n";
  6. }
  7.  
  8. void caller(void (*fn)(const std::string&))
  9. {
  10. fn("hello world");
  11. }
  12.  
  13. int main()
  14. {
  15. caller(target);
  16. }
  17.  
Success #stdin #stdout 0s 3272KB
stdin
Standard input is empty
stdout
fn hello world