Difference between Function to pointer and pointer to function

Difference between Function to pointer and pointer to function

A function to pointer is one which returns a pointer.

Ex: int *add(int num1,int num2) {
.
.
}

A pointer to function points to a function.

Ex: int add();
int (*addi)();
addi =&add;
then (*addi)() represents add();

A pointer to a function is a pointer that points to a function. A function pointer is a pointer that either has an indeterminate value, or has a null pointer value, or points to a function
#pragma statements
The #pragma Directives are used to turn ON or OFF certain features. They vary from compiler to compiler. Examples of pragmas are:.....
Advantages of using macro
Macros substitute a function call by the definition of that function. This saves execution time to a great extent.....
Self-referential structure
A self referential structure is used to create data structures like linked lists, stacks, etc.....
Post your comment