Home > Back-end >  How to define a function pointer array
How to define a function pointer array

Time:11-18

#include

Int fun (int a, int b)
{
Printf (" xingbu \ n ");
}
Int main ()
{
//int (* a [10]) (int, int); This is the
(int (*) (int, int)) a, [10].//this is wrong
A [0]=fun;
Int (* b) (int, int);
B=a, [0].
B (0, 0);

return 0;
}

(int (*) (int, int)) a, [10]. Why don't the definition method right?
(int (*) (int, int)) this form is not a form of data?

Done a problem know a function address if is 0 x8004 8000
The return value is an int type two parameters are of type int topic request according to boycott calls the function

You can define an int (* p) (int, int);
P=(int (*) (int, int)) is 0 x8004800 can run this function

When I wrote a code to run is a function will address the address values,
Again for this address type conversion is can use

  • Related