Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int x(int);
- char * y(char *);
- int main() {
- x(5);
- y("hello");
- int (*p) (int); //pointer to function x
- char * (*q) (char *); //pointer to function y
- p = &x; //holds the address of function x
- q = &y; //holds the address of function y
- cout << p << endl;
- cout << q;
- return 0;
- }
- int x(int a) {
- return (a * a);
- }
- char * y(char *b) {
- return (b);
- }
- cout << (void*)p << endl;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement