First you are trying to create a function pointer to a void function but since you don't state the return type of your function it defaults to returning an int.
And since you are returning a value it should be:
So now in main instead of trying to make a pointer to a function returning nothing you should be trying to make a pointer to a function returning an int.
Second in main() (which also should be int main() and return an int) you are just creating a pointer variable, not a pointer to a function. To create a pointer to a function you must include the (). Then you must de-reference the pointer when assigning the value.
So what you need to do is:
Code:
#include<stdio.h>
int func()
{
return printf("Hi");
}
int main()
{
int mretunValue
int (*fptr)();
fptr = &func;
mreturnValue = (*fptr)();
return(0);
}
See this link
Function Pointers.
Jim