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

Re: pointer to function



Hi 

 Following code works. Try it out..

#include <stdio.h>

void *function(void);

main()
{
 void (*f)(void);

 f=function();

 printf("\nPointer obtained..");
 printf("\nInvoking function using pointer.");

 (*f)();

}

void *function(void)
 {
  int i;
  printf("\n In the function..");

  return(function);
 }


HTH

  Bye
   Shridhar

On Fri, 19 May 2000, Rajeev Jha wrote:

> Hi
> can a function return a pointer to itself ?