What is difference between function to pointer and pointer to function?

Answer:
Pointer to function means a pointer which can hold the address of a function. For example:
int (*p)();

Here p is pointer to function which can hold address of such function which has only one argument which is void and return type is int data type. For example:
int add();
p=add;

While a function to pointer is meaning less statement.  A function cannot point any type of object. But you can think functions to pointer as pointer to function i.e. both are same statement.

No comments: