fork download
  1. #include <iostream>
  2. using namespace std;
  3. typedef const char * (*funcptr)();
  4. funcptr s;
  5. void setFuncPtr(funcptr t)
  6. {
  7. s = t;
  8. }
  9.  
  10. int main() {
  11. // your code goes here
  12. setFuncPtr([]{return "Hello \n"; });
  13. printf("%s\n", s());
  14. return 0;
  15. }
Success #stdin #stdout 0s 3296KB
stdin
Standard input is empty
stdout
Hello