Sayan Mukherjee
December 26th, 2002, 03:55 AM
Hi,
I have a the following declarations in my C code:
void func1(void); // Prototype of function func1()
long *p = ... // pointer to long which contains a valid address.
// The address is that of the function func1()
void (*fptr)(void); // This is the function pointer
This address in 'p' is, as stated above, the address of the function func1().
How do I assign from pointer 'p' to pointer 'fptr' so that the
function executes if called as given below:
fptr();
Thanks in advance.
I have a the following declarations in my C code:
void func1(void); // Prototype of function func1()
long *p = ... // pointer to long which contains a valid address.
// The address is that of the function func1()
void (*fptr)(void); // This is the function pointer
This address in 'p' is, as stated above, the address of the function func1().
How do I assign from pointer 'p' to pointer 'fptr' so that the
function executes if called as given below:
fptr();
Thanks in advance.