Guest User

Untitled

a guest
Oct 25th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int x(int);
  6. char * y(char *);
  7.  
  8. int main() {
  9.  
  10. x(5);
  11. y("hello");
  12.  
  13. int (*p) (int); //pointer to function x
  14. char * (*q) (char *); //pointer to function y
  15.  
  16. p = &x; //holds the address of function x
  17. q = &y; //holds the address of function y
  18.  
  19. cout << p << endl;
  20. cout << q;
  21.  
  22. return 0;
  23. }
  24.  
  25. int x(int a) {
  26. return (a * a);
  27. }
  28.  
  29. char * y(char *b) {
  30. return (b);
  31. }
  32.  
  33. cout << (void*)p << endl;
Add Comment
Please, Sign In to add comment