A pointer which holds the address of a function is known as a pointer to function.
syntax:
//void parameter
int * function();
int *(*ptr)();
ptr=&function;
// function with two parameters
char * call(int *,float *);
char *(*ptr)(int*,float *);
Here ptr is pointer to function.
Example:
Output: 10
Explanation:
Here function is a function whose parameter is void data type and return type is a pointer to int data type.
No comments:
Post a Comment