The purpose of typedef is to assign alternative names to existing type.
In your case statement " typedef int (*pFunc) (int);" just assign a new
name pFunc to pointer to function declaration " int (*pFunc) (int);". This
statement is not define any variable. Please see below working code.
#include <stdio.h>
#include <stdlib.h>
int func(int);
int main(int count,char *argv[])
{
typedef int (*pFunc) (int);
* pFunc pf;
*
* pf = func;*
getchar();
}
Regards,
Shafi
On Tue, Oct 30, 2012 at 1:41 AM, 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.
>
--
Regards,
Shafi Ahmad
http://in.linkedin.com/in/shafiahmad/
"The difficult we do immediately, the impossible takes a little longer" -
US Army
--
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.