A function pointer is a variable that stores the address of a function that can later be called through that function pointer. We can also call the function by its name or with a pointer.
When should we call a function by a pointer ?
When should we call a function by a pointer ?
C:
#include<stdio.h>
void function ()
{
printf ("Task1 \n");
}
int main ()
{
function();// calling function by its name
void (*pointer)(void) = &function;
(*pointer)();
return 0;
}