fork download
  1. #include <iostream>
  2. #include <string>
  3.  
  4. class Foo
  5. {
  6. public:
  7. void memberFunction(int a ,std::string b){
  8. std::cout<<a<<b<<'\n';
  9. }
  10.  
  11. };
  12.  
  13. //farzan agar in function dakhel library bashe
  14. void func2(void(*newFunctionName)(int,std::string))
  15. {
  16. newFunctionName(5,"test");
  17. }
  18.  
  19. void wrapperFunction(int a,std::string b)
  20. {
  21. Foo foo;
  22. foo.memberFunction(a,b);
  23. }
  24.  
  25. int main()
  26. {
  27. func2(&wrapperFunction);
  28. }
  29.  
Success #stdin #stdout 0s 3428KB
stdin
Standard input is empty
stdout
5test