[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

Re: pointer to function




On Fri, 19 May 2000, Shridhar Daithankar wrote:

> void *function(void)
>  {
>   int i;
>   printf("\n In the function..");
> 
>   return(function);
>  }
	If you are a language lawyer, cc -ansi -pedantic will tell you
that "ANSI forbids return between function pointer and `void *' ". 
A silly way to solve the problem is to return a pointer to a structure
whose field contains a pointer to the function. This way, you are
writing 'strict' ANSI C!
	
					pramode
					---------