Advertisement
Guest User

Untitled

a guest
Jul 19th, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. // Example program
  2. #include <iostream>
  3. #include <string>
  4.  
  5. void (*foo)(int);
  6.  
  7. void foo_real(int n)
  8. {
  9. n = 50;
  10. std::cout << "Hello PICKLES" << n;
  11. }
  12.  
  13. void CallAFunc(void(*func)(int))
  14. {
  15. func(50);
  16. }
  17.  
  18. int main()
  19. {
  20. foo = foo_real;
  21. CallAFunc(foo);
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement