i have written this program with a pointer to function but it gives error
Lvalue required in function mainwhy?
#include<stdio.h>
fun();
main()
{
int fun();
int *ptr();
ptr=fun; //this line gives error
*ptr();
}
int fun()
{
printf("amol singh");
return 0;
}
Here is the working code: