because, pFunc is just a typedef. you'd have to instantiate a variable at least in order to call your function. like - typedef int (*pFunc) (int); pFunc fptr = func; //fptr is now a variable on stack which points to your function. fptr(5); // call that function.
On 30 October 2012 01:41, rahul sharma <[email protected]> wrote: > #include <stdio.h> > #include <stdlib.h> > > > int func(int); > int main(int count,char *argv[]) > { > typedef int (*pFunc) (int); > pFunc=func; > getchar(); > } > > > > > Y itz not compiling? > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
